You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Is Numbers bugged or do I need a different formula?

COUNTIFS function is being inconsistent. All of the formulas and cell formatting types are consistent across the tables. Week 1 is wrong, if I remove any 1 set of arguments from the formula in B8 in table 2, it returns a different result but it's still wrong. C8, D8, and E8 have the same formula and are correct. F8 is wrong, G8 is right for Employee5 but wrong for the others, so the only variable is the date range but its count is inconsistent. Is there a better way to count this using a different formula and is this something we should report? I know the date arrangement columns in table 1 (C-F) is weird but I had to flip the day/month and again, the cell type is consistent and the formula ranges are consistent. Thanks in advance for any insight!

Mac mini, macOS 13.6

Posted on Nov 14, 2023 9:15 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 14, 2023 11:07 AM

I suggest avoiding that simplified column. When you use partial dates and times, Numbers makes up the portion you omitted. Said another way, Numbers has many data types. One of them is a Date/Time value.


If you type:

"12:01:45 PM" Numbers will actually store that with the date on which you entered the time portion:


similarly, when you enter a Date only, Numbers will fill in the time field with the time at which you typed the Date.


I think the date in column B should be corrected to a proper date and put in column F like this:


select F2, then type (or copy and paste from here) the formula:

=DATE(RIGHT(B2, 4), MID(B2, 4, 2), LEFT(B2, 2))


shorthand for this is:

F2=DATE(RIGHT(B2, 4), MID(B2, 4, 2), LEFT(B2, 2))


fill the formula down by selecting cell F2, copy

select cell F2 thru the end of column F, paste


My final result looks like:

4 replies
Question marked as Top-ranking reply

Nov 14, 2023 11:07 AM in response to Superjuke

I suggest avoiding that simplified column. When you use partial dates and times, Numbers makes up the portion you omitted. Said another way, Numbers has many data types. One of them is a Date/Time value.


If you type:

"12:01:45 PM" Numbers will actually store that with the date on which you entered the time portion:


similarly, when you enter a Date only, Numbers will fill in the time field with the time at which you typed the Date.


I think the date in column B should be corrected to a proper date and put in column F like this:


select F2, then type (or copy and paste from here) the formula:

=DATE(RIGHT(B2, 4), MID(B2, 4, 2), LEFT(B2, 2))


shorthand for this is:

F2=DATE(RIGHT(B2, 4), MID(B2, 4, 2), LEFT(B2, 2))


fill the formula down by selecting cell F2, copy

select cell F2 thru the end of column F, paste


My final result looks like:

Nov 14, 2023 1:34 PM in response to Recycleur

I did a bit more research and I discovered why your SUMIFS were not always yielding the correct results. At first I thought that values in the Simplified column were text and not dates, but they were really dates. No just in the correct year.


It turns out that if you enter 10/03 in an English file, Numbers interprets it as 1 October 2003, but if you enter 10/3 Numbers interprets it as 3 October 2023 (or the current year). However, in a French Canada file 10/03 and 10/3 both correctly return 10 March 2023 (or current year), while in a French France file, 10/03 has a date value of 1 October 2003 and 10/3 has a date value of 10 March 2023 (or current year). Inverting the parts of the simplified date returns other good or erroneous values as demonstrated in the picture below.


So the important takeaway is that when building a date from separate parts don't make a string, assemble it using the function DATE even if you choose a format to only display two. And be careful when typing those dates manually, be mindful of the locale.




For those who don't know, you can change the language of your file in the File / Advanced menu. That's useful when trying to copy formulas posted here mostly in English.


Nov 14, 2023 10:38 AM in response to Superjuke

I think you're complicating your life and the problem is the way you build and compare dates. It would have been interesting to see how you came up with the values in columns C, D, E, and F of Table 1.


I see column B (Date Created) contains a date in the format DD-MM-YYYY. Since it's left-aligned I'm tempted to say it's a string value and not a date value, hence your subsequent manipulations. What do get if you do a DATEVALUE (B2)? If the conversion happens well and you get a right-aligned date, then could could compare that directly to B2 and B3 in Table 2 (provided they are dates also).


If it doesn't convert correctly, you could still do that:

=DATE(RIGHT(B2,4), MID(B2,4,2),LEFT(B2,2))

Is Numbers bugged or do I need a different formula?

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