sumproduct/VLOOKUP with countif?

smandy

New Member
Joined
Jun 23, 2013
Messages
4
I am trying to do a count by text criteria for a particular date. The formula that that is currently in the spreadsheet is time consuming and user unfriendly and needs to have the range adjusted daily:

=COUNTIF('Data-All-2012-13'!$G$2886:$G$2906,"NTH")



[TABLE="width: 500"]
<TBODY>[TR]
[TD]Date[/TD]
[TD]NTH[/TD]
[TD]STH[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]20/6/2013[/TD]
[TD]Formula here totalling # of NTH for 20/6/2013[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]21/6/2013[/TD]
[TD]Formula here totalling # of NTH for 21/6/2013[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]


'Data-All-2012-13' is the sheet being referenced:
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Date[/TD]
[TD]Group[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20/6/2013[/TD]
[TD]NTH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20/6/2013[/TD]
[TD]STH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20/6/2013[/TD]
[TD]NTH[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]


Neither of the 2 formulas below have worked:

=SUMPRODUCT(--('Data-All-2012-13'!$G$4:$G$3000=DATE(21,6,2013)),--('Data-All-2012-13'!$G$4:$G$3000=NTH"))

{=SUM(('Data-All-2012-13'!$D$4:$D$4002=$A312)*('Data-All-2012-13'!$G$4:$G$4002=B$4))}

any help would me muchly appreciated!
Thanks :)
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi

Are your dates actual discrete date values - they are not, for example, date & time (so non-whole numbers) or they are not text values instead of dates?

Regarding your SUMPRODUCT, DATE takes its arguments as Y,M,D so you look like you have them round the wrong way.
 
Upvote 0
Thanks for your reply, the dates are Australian, so 20/6/2013 is the correct way. With the SUMPRODUCT I experimented and it didnt work either way. Would it be in the date formatting? ie 2-Jun-13
 
Upvote 0
Did you apply the correct sequence of arguments to DATE() as I intimated? That would result in:

=SUMPRODUCT(--('Data-All-2012-13'!$G$4:$G$3000=DATE(2013,6,21)),--('Data-All-2012-13'!$G$4:$G$3000=NTH"))
 
Upvote 0
Thanks for your reply, the dates are Australian, so 20/6/2013 is the correct way. With the SUMPRODUCT I experimented and it didnt work either way. Would it be in the date formatting? ie 2-Jun-13

Hi smandy

Excel doesn't care about your formatting for the calculation. Formatting is for you, as a human, to make it pretty or easy to read.

So the question is: is it an excel date value (a number) or is it a text value?

You can test it using for ex.

=ISNUMBER(A1) where A1 would be the cell with the date.

This will help to understand the problem
 
Upvote 0
Thanks so much, I got the formula :

=SUMPRODUCT(--('Data-All-2012-13'!$D$4:$D$3000=DATE(2013,6,21)),--('Data-All-2012-13'!$G$4:$G$3000=NTH"))

to work, it was throwing back #NA due to the VLOOKUP in the range being accessed, I solved that with the iserror formula and viola!!

Thanks heaps for the input, much appreciated :)
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top