If then statements invloving dates

Randomhero180

New Member
Joined
Sep 14, 2011
Messages
44
Hey all,

I need to run a report based on dates withing the spreadsheet. Along with a conditional

For example if the date is between 9/1/11 and 9/30/11 in column H and for every instance of "Disc sent" in columns B through G I want it to count 1.

This is my first spreadsheet with a lot of coding and complex functions, I really appreciate the help!

RH
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hey all,

I need to run a report based on dates withing the spreadsheet. Along with a conditional

For example if the date is between 9/1/11 and 9/30/11 in column H and for every instance of "Disc sent" in columns B through G I want it to count 1.

This is my first spreadsheet with a lot of coding and complex functions, I really appreciate the help!

RH
Try this...

Use cells to hold the criteria:
  • J2 = 9/1/2011
  • K2 = Disc sent
Then:

=SUMPRODUCT((TEXT(H2:H20,"mmmyyyy")=TEXT(J2,"mmmyyyy"))*(B2:G20=K2))
 
Upvote 0
Dont mean to test you skills again... but I'm thinking about adding in another criteria to count.

This is what I modified your code to

=SUMPRODUCT((TEXT(Sheet1!H19:H12678,"mmmyyyy")=TEXT(G1,"mmmyyyy"))*(Sheet1!B19:G12678=A2))

This counts everything within the range that is in the month starting 9/1/2011 and that contains the value Disc Sent now how would I add another criteria?

For example each instance of Disc Sent belongs to a certain group, (A,B,C,D) and i want to count how many instances of Disc sent belong to each group, along with the total...

Thanks again!
 
Upvote 0
Dont mean to test you skills again... but I'm thinking about adding in another criteria to count.

This is what I modified your code to

=SUMPRODUCT((TEXT(Sheet1!H19:H12678,"mmmyyyy")=TEXT(G1,"mmmyyyy"))*(Sheet1!B19:G12678=A2))

This counts everything within the range that is in the month starting 9/1/2011 and that contains the value Disc Sent now how would I add another criteria?

For example each instance of Disc Sent belongs to a certain group, (A,B,C,D) and i want to count how many instances of Disc sent belong to each group, along with the total...

Thanks again!
Let's assume column A contains the group designation.

H1 = some group designation like A.

=SUMPRODUCT((Sheet1!A19:A12678=H1)*(TEXT(Sheet1!H19:H12678,"mmmyyyy")=TEXT(G1,"mmmyyyy"))*(Sheet1!B19:G12678=A2))
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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