Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 158
Default get a single count after looking up a set of values

Please pardon the reposting, my original got a lot of discussion, masking the
lack of a final solution.

On sheet1 I have a column with multiple names. I need a function (in one
cell, on a separate sheet) that can look up all those names from column B of
sheet2, and then count the occurance of a value in column H of those same
rows in sheet2. Here's the example:

Sheet1 (note that some rows are blank, and some names may appear 1 time):
Helen Back
Cyndi Lou Who


Cyndi Lou Who


Sam Spade

Sheet2 (names only appear once):
col B col H
Cyndi Lou Who R2
Dan Danger R1
Dou Luva R3
Hal Brook R2
Helen Back R1
Joe Mama R2
Lou Duva R2
Mai Tai R2
Roberta Flack R3
Ron Popeil R2
Sam Spade R2
Will Not R2
Yoda n/a

So I need a single formula that can lookup sheet1's names (in this case,
four of them) in col B of sheet2, then give me a count of all corresponding
values "<R1" in col H. If names are repeated in sheet1, I do need to
include the multiple occurences in my count.

Thanks in advance for any ideas!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default get a single count after looking up a set of values

Hi Andy

On sheet 1 in cell B1
=IF(A1="","",SUMPRODUCT(--(Sheet2!$B$1:$B$1000=A1),--(Sheet2!$H1$:$H$1000<"R1")))

Copy down column B as far as required

--
Regards

Roger Govier


"andy62" wrote in message
...
Please pardon the reposting, my original got a lot of discussion,
masking the
lack of a final solution.

On sheet1 I have a column with multiple names. I need a function (in
one
cell, on a separate sheet) that can look up all those names from
column B of
sheet2, and then count the occurance of a value in column H of those
same
rows in sheet2. Here's the example:

Sheet1 (note that some rows are blank, and some names may appear 1
time):
Helen Back
Cyndi Lou Who


Cyndi Lou Who


Sam Spade

Sheet2 (names only appear once):
col B col H
Cyndi Lou Who R2
Dan Danger R1
Dou Luva R3
Hal Brook R2
Helen Back R1
Joe Mama R2
Lou Duva R2
Mai Tai R2
Roberta Flack R3
Ron Popeil R2
Sam Spade R2
Will Not R2
Yoda n/a

So I need a single formula that can lookup sheet1's names (in this
case,
four of them) in col B of sheet2, then give me a count of all
corresponding
values "<R1" in col H. If names are repeated in sheet1, I do need to
include the multiple occurences in my count.

Thanks in advance for any ideas!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 158
Default get a single count after looking up a set of values

Thanks, but I am looking for a single formula in a single cell on a separate
sheet that can perform this function. This one, provided by Max, does the
trick except that it will only count a person once, whereas if someone shows
up three times in sheet1 I need them counted three times:

=SUMPRODUCT(ISNUMBER(MATCH(Sheet2!$B$2:$B$20,Sheet 1!$A$2:$A$100,0))*(Sheet2!$H$2:$H$20<"R1"))

Anyone have any ideas?

"Roger Govier" wrote:

Hi Andy

On sheet 1 in cell B1
=IF(A1="","",SUMPRODUCT(--(Sheet2!$B$1:$B$1000=A1),--(Sheet2!$H1$:$H$1000<"R1")))

Copy down column B as far as required

--
Regards

Roger Govier


"andy62" wrote in message
...
Please pardon the reposting, my original got a lot of discussion,
masking the
lack of a final solution.

On sheet1 I have a column with multiple names. I need a function (in
one
cell, on a separate sheet) that can look up all those names from
column B of
sheet2, and then count the occurance of a value in column H of those
same
rows in sheet2. Here's the example:

Sheet1 (note that some rows are blank, and some names may appear 1
time):
Helen Back
Cyndi Lou Who


Cyndi Lou Who


Sam Spade

Sheet2 (names only appear once):
col B col H
Cyndi Lou Who R2
Dan Danger R1
Dou Luva R3
Hal Brook R2
Helen Back R1
Joe Mama R2
Lou Duva R2
Mai Tai R2
Roberta Flack R3
Ron Popeil R2
Sam Spade R2
Will Not R2
Yoda n/a

So I need a single formula that can lookup sheet1's names (in this
case,
four of them) in col B of sheet2, then give me a count of all
corresponding
values "<R1" in col H. If names are repeated in sheet1, I do need to
include the multiple occurences in my count.

Thanks in advance for any ideas!




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default get a single count after looking up a set of values

Hi Andy

I can't figure out how to do it in a single cell, but working from the
same references as in Max's formula, you could modify my formula as
follows
=IF(B2="","",SUMPRODUCT(--(Sheet1!$A$2:$A$1000=B2),
--(Sheet1!$H$2:$H$1000<"R1"),--(Sheet1!$A$2:$A$1000<"")))

Enter this in cell C2 of sheet2 and copy down
Hide column C
in cell D2
=SUM(C:C) for your single formula

--
Regards

Roger Govier


"andy62" wrote in message
...
Thanks, but I am looking for a single formula in a single cell on a
separate
sheet that can perform this function. This one, provided by Max, does
the
trick except that it will only count a person once, whereas if someone
shows
up three times in sheet1 I need them counted three times:

=SUMPRODUCT(ISNUMBER(MATCH(Sheet2!$B$2:$B$20,Sheet 1!$A$2:$A$100,0))*(Sheet2!$H$2:$H$20<"R1"))

Anyone have any ideas?

"Roger Govier" wrote:

Hi Andy

On sheet 1 in cell B1
=IF(A1="","",SUMPRODUCT(--(Sheet2!$B$1:$B$1000=A1),--(Sheet2!$H1$:$H$1000<"R1")))

Copy down column B as far as required

--
Regards

Roger Govier


"andy62" wrote in message
...
Please pardon the reposting, my original got a lot of discussion,
masking the
lack of a final solution.

On sheet1 I have a column with multiple names. I need a function
(in
one
cell, on a separate sheet) that can look up all those names from
column B of
sheet2, and then count the occurance of a value in column H of
those
same
rows in sheet2. Here's the example:

Sheet1 (note that some rows are blank, and some names may appear 1
time):
Helen Back
Cyndi Lou Who


Cyndi Lou Who


Sam Spade

Sheet2 (names only appear once):
col B col H
Cyndi Lou Who R2
Dan Danger R1
Dou Luva R3
Hal Brook R2
Helen Back R1
Joe Mama R2
Lou Duva R2
Mai Tai R2
Roberta Flack R3
Ron Popeil R2
Sam Spade R2
Will Not R2
Yoda n/a

So I need a single formula that can lookup sheet1's names (in this
case,
four of them) in col B of sheet2, then give me a count of all
corresponding
values "<R1" in col H. If names are repeated in sheet1, I do need
to
include the multiple occurences in my count.

Thanks in advance for any ideas!






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
Count occurrences of values in a column??!! me123 Excel Worksheet Functions 5 May 10th 06 08:24 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
Return Range of Numerical Values in Single Column based on Frequency Percentage Sam via OfficeKB.com Excel Worksheet Functions 9 October 28th 05 11:01 PM
How to count a range of values in a single cell? nyc_doc Excel Worksheet Functions 3 August 3rd 05 12:30 AM
Count Unique Values annie Excel Worksheet Functions 1 June 9th 05 07:19 AM


All times are GMT +1. The time now is 02:23 PM.

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"