Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Countif cells within a week

  1. #1
    New Member
    Join Date
    Jul 2017
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default 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. #2
    Board Regular
    Join Date
    Nov 2006
    Location
    London
    Posts
    6,310
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Countif cells within a week

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

  3. #3
    Board Regular arthurbr's Avatar
    Join Date
    Dec 2006
    Location
    Zaventem
    Posts
    1,577
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default 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.
    Adapt range as needed
    Please,always use a relevant keyword thread title that describes what you are trying to do
    Using XL2003 - 2010

  4. #4
    New Member
    Join Date
    Jul 2017
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Countif cells within a week

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

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com