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
158 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

790 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