Thanks:  0
Likes:  0

# Thread: Countif cells within a week

1. ## Countif cells within a week

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,

2. ## Re: Countif cells within a week

=countifs(a1:a4,">="&today()-7,c1:c4,"ny")

3. ## Re: Countif cells within a week

Perhaps =SUMPRODUCT((A2:A5>(TODAY()-7))*(A2:A5 You might want to replace > by >= or < with <= if need be.

4. ## Re: Countif cells within a week

Thanks both, used both answers together to get a good working formula!

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•