Problem with SUMPRODUCT....help please!

T

Tasha

I am having trouble getting a count from a worksheet with multiple criteria.
Can someone look at this and see what I am doing wrong?

I have two worksheets, [DAILY ADMITS WORKSHEET.xls].[dly wrksht] is the
daily worksheet that changes every day, [PHYS_STATS_MTD] is the one I am
putting the calculation into for each day of the month. In [PHYS_STATS_MTD],
column B lists the PHYNO down(starting in cell B3) and column D lists the
date of the month across starting with cell D2, however is only the number of
the month. Formated to only show 'd'. Date is also set up that way in the
Daily Admits worksheet. I am trying to get a count of all physicians that
had admits for that day. It keeps giving me a 0.

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$136=B3)*('[DAILY
ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))
 
B

Bob Phillips

The ranges have to be the same size

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$2:$D$136=B3)*
('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
T

Toppers

I'm confused about the date and date format.

What exactly is in B3:B136 and what is in D2? For a particular day, if
B3:B3136 hold dates as a DATE format, then D2 needs to be the full date i.e.
to match day (16th July) D2 should be 16/07/2007 (UK dd/mm/y format).

How a date is formatted does represent how it is stored internally.
 
T

Tasha

that worked, I hadn't noticed my range begin was missing.....thanks!!!!

Bob Phillips said:
The ranges have to be the same size

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$2:$D$136=B3)*
('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



Tasha said:
I am having trouble getting a count from a worksheet with multiple
criteria.
Can someone look at this and see what I am doing wrong?

I have two worksheets, [DAILY ADMITS WORKSHEET.xls].[dly wrksht] is the
daily worksheet that changes every day, [PHYS_STATS_MTD] is the one I am
putting the calculation into for each day of the month. In
[PHYS_STATS_MTD],
column B lists the PHYNO down(starting in cell B3) and column D lists the
date of the month across starting with cell D2, however is only the number
of
the month. Formated to only show 'd'. Date is also set up that way in
the
Daily Admits worksheet. I am trying to get a count of all physicians that
had admits for that day. It keeps giving me a 0.

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$136=B3)*('[DAILY
ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))
 
T

Tasha

thanks Bob, that fixed the problem, I hadn't noticed my range begin cell was
missing!!!!

Bob Phillips said:
The ranges have to be the same size

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$2:$D$136=B3)*
('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



Tasha said:
I am having trouble getting a count from a worksheet with multiple
criteria.
Can someone look at this and see what I am doing wrong?

I have two worksheets, [DAILY ADMITS WORKSHEET.xls].[dly wrksht] is the
daily worksheet that changes every day, [PHYS_STATS_MTD] is the one I am
putting the calculation into for each day of the month. In
[PHYS_STATS_MTD],
column B lists the PHYNO down(starting in cell B3) and column D lists the
date of the month across starting with cell D2, however is only the number
of
the month. Formated to only show 'd'. Date is also set up that way in
the
Daily Admits worksheet. I am trying to get a count of all physicians that
had admits for that day. It keeps giving me a 0.

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$136=B3)*('[DAILY
ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))
 
T

Tasha

thanks for your reply, I was missing my range begin cell in my formula as Bob
so kindly pointed out for me!! :) Have a great day!

Toppers said:
I'm confused about the date and date format.

What exactly is in B3:B136 and what is in D2? For a particular day, if
B3:B3136 hold dates as a DATE format, then D2 needs to be the full date i.e.
to match day (16th July) D2 should be 16/07/2007 (UK dd/mm/y format).

How a date is formatted does represent how it is stored internally.

Tasha said:
I am having trouble getting a count from a worksheet with multiple criteria.
Can someone look at this and see what I am doing wrong?

I have two worksheets, [DAILY ADMITS WORKSHEET.xls].[dly wrksht] is the
daily worksheet that changes every day, [PHYS_STATS_MTD] is the one I am
putting the calculation into for each day of the month. In [PHYS_STATS_MTD],
column B lists the PHYNO down(starting in cell B3) and column D lists the
date of the month across starting with cell D2, however is only the number of
the month. Formated to only show 'd'. Date is also set up that way in the
Daily Admits worksheet. I am trying to get a count of all physicians that
had admits for that day. It keeps giving me a 0.

=SUMPRODUCT(('[DAILY ADMITS WORKSHEET.xls]dly wrksht'!$D$136=B3)*('[DAILY
ADMITS WORKSHEET.xls]dly wrksht'!$B$2:$B$136=D2))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top