Counting Col A contents if Col B returns a dedicated value.

BlueDingo

New Member
Joined
Oct 19, 2009
Messages
42
Good Afternoon (AEST) Aust,

Searching for a formula for the following:

Fields A1:A100 are filled with 4 specific dates (one is eg, 01-Aug-12) and Fields B1:B100 filled with YES or NO.

I need to conform to Excel 2003, to add the number of "01-Aug-12" if Col B returns a "YES".

Tried some of the formulas in the forum but not much luck, hence Excel 2003.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Good Afternoon (AEST) Aust,

Searching for a formula for the following:

Fields A1:A100 are filled with 4 specific dates (one is eg, 01-Aug-12) and Fields B1:B100 filled with YES or NO.

I need to conform to Excel 2003, to add the number of "01-Aug-12" if Col B returns a "YES".

Tried some of the formulas in the forum but not much luck, hence Excel 2003.

sumproduct will do the trick.

This is assuming that the date you want to ADD is in cell 'D1'.

=SUMPRODUCT(--(A1:A100=D1),--(B1:B100="Yes"))

Note that you can't use whole column refs with sumproduct (so no A:A).
 
Last edited:
Upvote 0
=SUMPRODUCT((A1:A100="Date1")*(B1:B100="Yes"))+SUMPRODUCT((A1:A100="Date2")*(B1:B100="Yes"))+SUMPRODUCT((A1:A100="Date3")*(B1:B100="Yes"))+SUMPRODUCT((A1:A100="Date4")*(B1:B100="Yes"))

Change Date1 Date2 Date3 Date4 to whatever the dates you are looking for are.
 
Upvote 0
For Sutto:

The dates I need to add appear in column A from row 1 through to row 100, not in cell D1.
I need to add how many have the date "01-Aug-12" and so forth.

For Sal paradise:

These need to be a sum for each date, not one total number by adding all dates together.

Thanks to you both.
 
Last edited:
Upvote 0
Sorry Sal, this is still not working for me.

=SUMPRODUCT((F$8:F$100="01-Oct-12")*(I$8:I$100="Yes")) Column i has two "yes" against "01-Oct-12" and its still returning zero.
 
Upvote 0
Chances are your dates are recorded as dates. In which case you can do one of two things:

1) Enter the number corresponding to that date.
2) Enter the date the old-fashioned way:


Excel 2003
ABC
1DateNumberDate Formula
22012/10/1411832012/10/1
Sheet1
Cell Formulas
RangeFormula
B2=TEXT(A2,"@")
C2=DATE(2012,10,1)


So either:

1) =SUMPRODUCT((F$8:F$100=41183)*(I$8:I$100="Yes"))
2) =SUMPRODUCT((F$8:F$100=DATE(2012,10,1))*(I$8:I$100="Yes"))
 
Upvote 0
Hello Sal, gee you're patient with this, I admit I'm a bit of a clutz with formulas, but here goes,

Col F Col G Col i
Sub
Date

PAR sent
Complete
Y/N

01-Oct-12
03-Aug-12
YES
01-Sep-12
30-Aug-12
YES
01-Oct-12
01-Aug-12
YES
01-Dec-12
NO
01-Dec-12
25-Nov-12
YES
01-Nov-12
20-Oct-12
YES

<TBODY>
</TBODY>



Therefore in the chart below, Col F should reveal:
SEP = 1
OCT = 2
SEP = 1
NOV = 1

Col E Col F Col G
Sub for:
Comp per mth:
% Comp
SEP=
2
0
0%
OCT=
25
0
0%
NOV=
26
0
0%
DEC=
22
0
0%

<TBODY>
</TBODY>


Regards, Pete (Private MSG was accidently deleted)
 
Upvote 0
Okay, that is a totally different question since you are looking for any date within a month...

In that case, you should use:
=SUMPRODUCT((F$8:F$100>=DATE(2012,10,1))*(F$8:F$100<DATE(2012,11,1))*(I$8:I$100="Yes"))

That will return the number of dates after October 1st, but before November 1st (all days in October).
 
Upvote 0

Forum statistics

Threads
1,216,057
Messages
6,128,527
Members
449,456
Latest member
SammMcCandless

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