Results 1 to 8 of 8

Thread: SUMIF Formula where Excel is treating the Date criteria as Text
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jun 2015
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default SUMIF Formula where Excel is treating the Date criteria as Text

    Hi, I have a very simple SUMIF formula =sumif(L:L,O6,H:H) Where L:L are week commencing dates and O6 is the week commencing date I want summed from numbers in column H:H. As I'm building the formula, I can see it is treating the dates as a number, 43464.

    The result should be 22, but I keep getting 0, I am presuming it is because of this issue.

    I have ensured that the formatting of the dates is the same & looked through forums to try to understand how to rectify this, but I'm lost - if this is the problem.

    Thanks in advance.

  2. #2
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,986
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    I'd say the more likely cause is that either the numbers in column H are actually text, or the dates really don't match (eg if there's a time portion in one or other).

  3. #3
    New Member
    Join Date
    Jun 2015
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    Hi Rory,

    Thank you for your reply. The more I try to learn the less I seem to know!

    The dates in L:L are actually a formula, G1-WEEKDAY(G1)+1, where G1 is a manually inputted date, so I cannot see if, as per your suggestion, if there is time etc. being added to cause the conflict in formatting, or is the formula causing the conflict?
    Dave

  4. #4
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,986
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    That would make me think that my first suggestion is the problem. What does:

    =countif(L:L,O6)

    return?

  5. #5
    New Member
    Join Date
    Jun 2015
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    22!

  6. #6
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,986
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    That does tend to confirm that the numbers in H are not numbers. What does:

    =SUM(H:H)

    return? 0?

  7. #7
    New Member
    Join Date
    Jun 2015
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    Hi Rory,

    God, I've just spotted my error - what a dipstick...in H, I have another formula to simply put enter a 1 for me to finally work out %, I had written: IF(G1>0,"1","") meaning I was entering the 1 as text even though it was formatted as a number...gah...corrected & now the SUMIF works!

    Thank you for your time in replying & helping me to work through & find the error!

  8. #8
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,986
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: SUMIF Formula where Excel is treating the Date criteria as Text

    Glad to help.

Some videos you may like

User Tag List

Tags for this Thread

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
  •