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
151 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

757 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

18 Experts available now in Live!

Get 1:1 Help Now