[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
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
Medium Priority
?
178 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 total points
ID: 36503544
Try using wildcards with COUNTIF, e.g.

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

regards, barry
0
 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

834 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