Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paputxi
 
Posts: n/a
Default How to Count Substrings InTwo Columns

I know that using the following SUMPRODUCT function below on the data also
shown below, I get a count result of 2 for matches found in rows 1 and 3.

=SUMPRODUCT((A1:A7="a-1")*(B1:B7="s-1"))

Col A Col B
Row 1 a-1 s-1
Row 2 a-1 s-2
Row 3 a-1 s-1
Row 4 a-4 s-3
Row 5 a-5 s-1
Row 6 b-1 t-1
Row 7 b-2 t-2

However, I can't seem to figure out how to use substrings such that I want
to match any "a" in Col A and only where "s-1" appears in Col B. Using the
data above, I would expect a count result of 3 for counting rows 1, 3 and 5.

Any suggestions would be greatly appreciated. And, thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default How to Count Substrings InTwo Columns

If any "a" means starting with "a"

=SUMPRODUCT(--(LEFT(A1:A7)="a"),--(B1:B7="s-1"))

if it means anywhere

=SUMPRODUCT(--ISNUMBER(SEARCH("a",A1:A7)),--(B1:B7="s-1"))

--

Regards,

Peo Sjoblom

Northwest Excel Solutions

www.nwexcelsolutions.com

(remove ^^ from email address)

Portland, Oregon




"Paputxi" wrote in message
...
I know that using the following SUMPRODUCT function below on the data also
shown below, I get a count result of 2 for matches found in rows 1 and 3.

=SUMPRODUCT((A1:A7="a-1")*(B1:B7="s-1"))

Col A Col B
Row 1 a-1 s-1
Row 2 a-1 s-2
Row 3 a-1 s-1
Row 4 a-4 s-3
Row 5 a-5 s-1
Row 6 b-1 t-1
Row 7 b-2 t-2

However, I can't seem to figure out how to use substrings such that I want
to match any "a" in Col A and only where "s-1" appears in Col B. Using
the
data above, I would expect a count result of 3 for counting rows 1, 3 and
5.

Any suggestions would be greatly appreciated. And, thanks in advance.


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
Total Summed Count of Numeric Repeat (Paired /Double Instance) Criteria Sam via OfficeKB.com Excel Worksheet Functions 2 March 20th 06 02:29 AM
how to count one value or another across multiple columns? MeatLightning Excel Discussion (Misc queries) 10 May 22nd 05 09:23 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 0 May 15th 05 08:14 PM
count number of cells based on TWO conditions (2 different columns Troi-Xanh Excel Worksheet Functions 2 February 12th 05 12:46 AM


All times are GMT +1. The time now is 07:22 AM.

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

About Us

"It's about Microsoft Excel"