Sumifs not returning correct value for a date range?

Hi! I have recently learned (sort of) how to use this function. I am using it to calculate the flying hours I have logged during certain periods, e.g: january 2011, or specific dates ranges.


The formula will work correctly if I input cells B9 and B11 as the same value (the same date), and the value returned in cell B6 is correct...


however when I put in different values in cells B9 and B11 (a date range), the value returned in B6 is incorrect!

I am expecting a value of "1.9" in one example, however the value returned is "2.6"

~And yes, I have rechecked the values so it's not just my bad maths!


I am thinking my date formats are the problem maybe?


the sheet named "Logbook Entries" has the same format as cells B9 & B11 as per the screenshot. These "dates" are not actually in the date format I believe as they appear as "Text" as per the second screeenshot. I should have thought to input them as proper dates back when I first started this spreadsheet in 2011..


I can't work out how to convert them now though if this is the problem?

(there are nearly 1000 entries so would prefer not to manually re-enter them again as dates!)


Any help would be greatly appreciated!


Thanks

User uploaded fileUser uploaded file

MacBook Air, OS X Mavericks (10.9.2)

Posted on Apr 14, 2014 3:36 PM

Reply
19 replies

Apr 15, 2014 3:53 AM in response to michaellusty

On my machine I input Mar-07-2011 as text (by typing and single quote and then the value). This is what I see (lower left):


User uploaded files


Then I selected the cell and formatted as Date & Time (you can choose your preferred date format):


User uploaded file


Then I see this:


User uploaded file


Numbers now clearly recognizes it as a date-time string.


You should be able to select the cells with "dates" and convert them this way.


If you can't, post, and I can suggest an AppleScript that may help.


SG

Apr 15, 2014 7:08 AM in response to michaellusty

michaellusty wrote:


Hi yeah thats what I mentioned initially. The "date" values are actually just text values entered in the format

"Mar-07-2011".


Would this make a difference?


Any idea how to convert them to a proper date format?

My motive in having you sort the Dates, before I offered to look at the file, was to ferret out any wrongly formatted cells. Of course text will not behave correctly, in sorting or in conditional tests, but I didn't pursue this because the file you sent me has properly formatted dates. If you think this could be happening anywhere else in your document it would pay to examine it closely.


Jerry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Sumifs not returning correct value for a date range?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.