Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default find text and count word 2 cells beside

have a word in cell B10 (BOX195) and want to find all the BOX195 in column
B:B and count how may have the word OUT in the column D. Note it is a big
database with lots of different BOX numbers.

??? =COUNTIF(B:B=B10,and(D:D="OUT")) ???
??? =COUNTIF(B:B,B10,D:D="OUT") ???

Column A Column B Column C Column D
1 BOX085 bbb OUT
2 BOX195 BBB OUT
3 BOX102 bbb OUT
4 BOX195 BBB IN
5 BOX102 bbb IN
6 BOX195 BBB OUT
7 BOX085 bbb IN
8 BOX195 BBB OUT
9 BOX085 bbb OUT
10 BOX195 BBB IN
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default find text and count word 2 cells beside

Hi David

The double nary minus (--) is one way of coercing the True/False result from
the tests to 1/0 so they can be summed in Sumproduct.

B1=B10 would return True or False let's assume False
D1="OUT" would return True or False let's assume True
so we would get
0 * 1 = 0
If for B2 and D2 we got True and True we would get
1 * 1 = 1

So, only when both conditions are True (1) would we get a result of 1, all 3
other combinations would return 0 so Sumproduct just sums all these 0's and
1's to give the number of cases when both tests are True.
--
Regards
Roger Govier

"David GG" wrote in message
...
Thanks Roger it worked
Stupid question though what do the -- do in the formula?

"Roger Govier" wrote:

Hi David

=SUMPRODUCT(--($B$1:$B$1000=B10),--($D$1:$D$1000="OUT"))

--
Regards
Roger Govier

"David GG" <David wrote in message
...
have a word in cell B10 (BOX195) and want to find all the BOX195 in
column
B:B and count how may have the word OUT in the column D. Note it is a
big
database with lots of different BOX numbers.

??? =COUNTIF(B:B=B10,and(D:D="OUT")) ???
??? =COUNTIF(B:B,B10,D:D="OUT") ???

Column A Column B Column C Column D
1 BOX085 bbb OUT
2 BOX195 BBB OUT
3 BOX102 bbb OUT
4 BOX195 BBB IN
5 BOX102 bbb IN
6 BOX195 BBB OUT
7 BOX085 bbb IN
8 BOX195 BBB OUT
9 BOX085 bbb OUT
10 BOX195 BBB IN



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a formula to 'find' word in cells of column from a long list Deden Excel Worksheet Functions 10 November 26th 08 02:30 AM
Find, count and extract duplicate cells Igby Excel Worksheet Functions 1 December 9th 07 06:42 PM
Count Occurance of Text/Word in a Range JPH Excel Discussion (Misc queries) 1 October 25th 07 05:02 PM
Count single Text in cells with multiple text entries WSC Excel Discussion (Misc queries) 6 January 9th 07 04:17 PM
In Excel, how do I find one word in a set of text in a cell? man818 Excel Discussion (Misc queries) 4 May 20th 06 02:20 PM


All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"