Link to home
Start Free TrialLog in
Avatar of groovymonkey
groovymonkeyFlag for Canada

asked on

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

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)
Avatar of StephenJR
StephenJR
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you mean like this?

=IF(ISNUMBER(FIND(B2,S2)),B2,"")
Btw FIND is case sensitive, but SEARCH is not.
Avatar of groovymonkey

ASKER

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
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.
ASKER CERTIFIED SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Doh!
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))
Did you enter it as an array formula?

In any case Barry's formula is much better.
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
Awesome!