SUMIF Formula where Excel is treating the Date criteria as Text

DaveMitch

New Member
Joined
Jun 19, 2015
Messages
18
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.
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,793
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
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).
 

DaveMitch

New Member
Joined
Jun 19, 2015
Messages
18
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
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,793
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
That would make me think that my first suggestion is the problem. What does:

=countif(L:L,O6)

return?
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,793
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
That does tend to confirm that the numbers in H are not numbers. What does:

=SUM(H:H)

return? 0?
 

DaveMitch

New Member
Joined
Jun 19, 2015
Messages
18
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!
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,793
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Glad to help. :)
 

Watch MrExcel Video

Forum statistics

Threads
1,095,227
Messages
5,443,212
Members
405,219
Latest member
CraneS

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top