Solved

MS EXCEL COUNTIF can it be used to pull a string value from a cell that has multiple string combinations

Posted on 2011-09-08
10
152 Views
Last Modified: 2012-05-12
Hello,
I am by no means knowledgebale with MS Excell so bear with me....I am currently using the following in excel...what I want to do is figure out if there is a way to look at the cell and if there is a value like eee www bbb in s2 etc...still  be able to pull out the eee (lets say this is the value of b2) and when it gets to the next row (b3) pull out  and count the www if this is what B3 is defined as...

=COUNTIF(Log!$S$2:S$1000,B2)
0
Comment
Question by:groovymonkey
  • 5
  • 3
  • 2
10 Comments
 
LVL 24

Expert Comment

by:StephenJR
ID: 36503413
Do you mean like this?

=IF(ISNUMBER(FIND(B2,S2)),B2,"")
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 36503419
Btw FIND is case sensitive, but SEARCH is not.
0
 

Author Comment

by:groovymonkey
ID: 36503464
hmm I do not think that is what I mean...okay here is what the table sort of looks like

I have a column with category...but there are multiple categories so instead of creating the categories across the top (a column for each) I would like to place MULTIPLE acronymns in the category cell ....
e.g.
worksheet log (column S)

Category
awol pita
pita rem

in another worksheet I am attempting to tally each category

awol    1
pita      2
rem      1
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 36503494
I think this array formula works (ctrl+shift+enter to use)

=SUM(IF(ISNUMBER(FIND(B2,$S$2:$S$3)),1,0))

if your categories are listed in B2 down and your log is S2 and down - adjust as necessary.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36503544
Try using wildcards with COUNTIF, e.g.

=COUNTIF(Log!$S$2:S$1000,"*"&B2&"*")

regards, barry
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 24

Expert Comment

by:StephenJR
ID: 36503557
Doh!
0
 

Author Comment

by:groovymonkey
ID: 36503575
tried this...not working only summed one category and it only counted one of the entries (there were 2)

=SUM(IF(ISNUMBER(FIND(B2,Log!$T$2:Log!$T$1000)),1,0))
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 36503595
Did you enter it as an array formula?

In any case Barry's formula is much better.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36503602
Did you try my COUNTIF suggestion?....or Stephen's version needs to be confirmed with CTRL+SHIFT+ENTER...

The FIND (or SEARCH) approach is a valid alternative - it can be useful if you want case-sensitivity (FIND) or if you want to search for text that might be included in other text, e.g. if you want to search for "ee" and separately "eee" then my COUNTIF version will count any "ee"s which are included in "eee"s, so assuming that each category is separated by a space in column S you could use this version

=SUMPRODUCT(ISNUMBER(SEARCH(" "&B2&" "," "&$S$2:$S$1000&" "))+0)

regards, barry
0
 

Author Closing Comment

by:groovymonkey
ID: 36504025
Awesome!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now