Countif cells within a week

conroar

New Member
Joined
Jul 17, 2017
Messages
4
Hi, I'm working on a project and am trying to get a function to do a lookup. If Date(A) is within the past 7 days and (C) is "New York" then it counts towards the total.



A B C
1 Date | Name | Location

2 17/07/2017| Bob | New York
3 09/07/2017| Steve | New York
4 11/07/2017| Larry | New York
5 17/07/2017| Jeff | Mumbai


The outcome should say "2". As C2,C3 & C4 all say "New York" but A3 is not within the past 7 days.

Regards,
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Perhaps =SUMPRODUCT((A2:A5>(TODAY()-7))*(A2:A5<TODAY())*(C2:C5="New York"))
You might want to replace > by >= or < with <= if need be.
Adapt range as needed
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,908
Members
448,532
Latest member
9Kimo3

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