Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Counting Data from Another Worksheet - Countif


Okay, I have data on two worksheets. Two columns on each worksheet, one
is "NAME" and one is "DATE".

Sheet1:

NAME DATE
BOB 7/31/06
STEVE 7/31/06
JOE 7/31/06
KEVIN 7/31/06

Sheet2:

NAME DATE
BOB 8/15/06
BOB 7/15/06
BOB 6/15/06
STEVE 9/15/06
STEVE 8/15/06
STEVE 7/15/06
STEVE 6/15/06
JOE 5/15/06
JOE 4/15/06
KEVIN 7/15/06
KEVIN 6/15/06
KEVIN 5/15/06

So what I want is a formula on each row on Sheet1 that tells me how
many times a particular name from Sheet1 has a corresponding date on
Sheet2 that occurs before the date on Sheet1. For instance, the first
row on Sheet1 has Bob 7/31/06. So I'd want to know how many dates for
Bob on Sheet2 occur before 7/31/06.

If I do COUNTIF(Sheet2!B2:B4,"<="&b2) it returns the correct result,
but I have to change the range it's looking manually for each line.
How do I get it to find it's own range based on the Name from the first
sheet?

Thanks in advance.


--
quiksilver
------------------------------------------------------------------------
quiksilver's Profile: http://www.excelforum.com/member.php...o&userid=37021
View this thread: http://www.excelforum.com/showthread...hreadid=567455

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Counting Data from Another Worksheet - Countif

I put this in C2 of Sheet1:

=SUMPRODUCT(--(Sheet2!$A$2:$A$13=A2),--(Sheet2!$B$2:$B$13<B2))

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

========
You said before, but you use <= in your sample. I'm not sure what you really
want.

quiksilver wrote:

Okay, I have data on two worksheets. Two columns on each worksheet, one
is "NAME" and one is "DATE".

Sheet1:

NAME DATE
BOB 7/31/06
STEVE 7/31/06
JOE 7/31/06
KEVIN 7/31/06

Sheet2:

NAME DATE
BOB 8/15/06
BOB 7/15/06
BOB 6/15/06
STEVE 9/15/06
STEVE 8/15/06
STEVE 7/15/06
STEVE 6/15/06
JOE 5/15/06
JOE 4/15/06
KEVIN 7/15/06
KEVIN 6/15/06
KEVIN 5/15/06

So what I want is a formula on each row on Sheet1 that tells me how
many times a particular name from Sheet1 has a corresponding date on
Sheet2 that occurs before the date on Sheet1. For instance, the first
row on Sheet1 has Bob 7/31/06. So I'd want to know how many dates for
Bob on Sheet2 occur before 7/31/06.

If I do COUNTIF(Sheet2!B2:B4,"<="&b2) it returns the correct result,
but I have to change the range it's looking manually for each line.
How do I get it to find it's own range based on the Name from the first
sheet?

Thanks in advance.

--
quiksilver
------------------------------------------------------------------------
quiksilver's Profile: http://www.excelforum.com/member.php...o&userid=37021
View this thread: http://www.excelforum.com/showthread...hreadid=567455


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Counting Data from Another Worksheet - Countif


Dave Peterson Wrote:

You said before, but you use <= in your sample. I'm not sure what you
really
want.


Yeah, I should have said "on or before". How would that change the
formula?


--
quiksilver
------------------------------------------------------------------------
quiksilver's Profile: http://www.excelforum.com/member.php...o&userid=37021
View this thread: http://www.excelforum.com/showthread...hreadid=567455

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Counting Data from Another Worksheet - Countif

change the < to <=


quiksilver wrote:

Dave Peterson Wrote:

You said before, but you use <= in your sample. I'm not sure what you
really
want.


Yeah, I should have said "on or before". How would that change the
formula?

--
quiksilver
------------------------------------------------------------------------
quiksilver's Profile: http://www.excelforum.com/member.php...o&userid=37021
View this thread: http://www.excelforum.com/showthread...hreadid=567455


--

Dave Peterson
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
Look up Data from Worksheet within same Workbook Max Excel Discussion (Misc queries) 0 May 10th 06 06:50 AM
Ignoring Rows When Extracting Data From One Worksheet To Another Jim J. Excel Worksheet Functions 2 May 8th 06 04:55 PM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
Saving data in a worksheet within a workbook Homeuser Excel Discussion (Misc queries) 2 August 21st 05 10:49 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM


All times are GMT +1. The time now is 11:48 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"