[Solved] Count number of dates in current month
-
- Posts: 8
- Joined: Mon Dec 05, 2016 4:34 pm
[Solved] Count number of dates in current month
Hi all,
I am struggling to find way to Count number of dates in current month. My column has conditional formatting showing all dates that fall in current month. Can you help me count them?
Thank you
Maggie
I am struggling to find way to Count number of dates in current month. My column has conditional formatting showing all dates that fall in current month. Can you help me count them?
Thank you
Maggie
Last edited by Hagar Delest on Mon Dec 05, 2016 10:34 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
openoffice 5.2 on Windows 10
Re: Count number of dates in current month
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 8
- Joined: Mon Dec 05, 2016 4:34 pm
Re: Count number of dates in current month
Hi, thanks for that.
I don't need number of days in current month or a particular month. I have a column called Date Acquired and need to see the dates in the column that are in the current month. Hope that makes
Maggie
I don't need number of days in current month or a particular month. I have a column called Date Acquired and need to see the dates in the column that are in the current month. Hope that makes
Maggie
openoffice 5.2 on Windows 10
Re: Count number of dates in current month
If the dates are in A1:A10, something like this should work:
=SUMPRODUCT(MONTH(A1:A10)=MONTH(TODAY()))
Note: if you have empty cells, or non-date cells in that range, the formula will need to be changed or it may give the wrong answer.
=SUMPRODUCT(MONTH(A1:A10)=MONTH(TODAY()))
Note: if you have empty cells, or non-date cells in that range, the formula will need to be changed or it may give the wrong answer.
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 8
- Joined: Mon Dec 05, 2016 4:34 pm
Re: Count number of dates in current month
Hi there, do you have it so it will work with dates? Thank you so much.
Maggie
Maggie
openoffice 5.2 on Windows 10
Re: Count number of dates in current month
Yes, that works with dates. MONTH takes a date and returns the month number: MONTH("2016-12-05") returns 12.
If the formula isn't working, your dates may actually be text, in which case it may produce an error.
If the formula isn't working, your dates may actually be text, in which case it may produce an error.
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 8
- Joined: Mon Dec 05, 2016 4:34 pm
Re: Count number of dates in current month
Hi, my column is set to dates but the formula is returning random numbers for the column range. I've attached the sheet and highlighted where I need the calculation to be. can you please take a peek?
- Attachments
-
- Untitled 1.ods
- (17.81 KiB) Downloaded 101 times
openoffice 5.2 on Windows 10
Re: Count number of dates in current month
The formula won't work with empty cells: it takes an empty cell as zero, which represents a date in December.
The attached sheet has a modified formula that ignores empty cells:
=SUMPRODUCT(M10:M20<>"";MONTH(M10:M20)=MONTH(TODAY()))
Setting a cell format to "Date" does not change the type of data stored in the cell. You can check the data type using View > Value Highlighting: ON: text data will appear in black; numbers or dates in blue.
The attached sheet has a modified formula that ignores empty cells:
=SUMPRODUCT(M10:M20<>"";MONTH(M10:M20)=MONTH(TODAY()))
Setting a cell format to "Date" does not change the type of data stored in the cell. You can check the data type using View > Value Highlighting: ON: text data will appear in black; numbers or dates in blue.
- Attachments
-
- count_dates_sample.ods
- (15.27 KiB) Downloaded 132 times
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 8
- Joined: Mon Dec 05, 2016 4:34 pm
Re: Count number of dates in current month
That's really helpful, thank you very much indeed.
maggie
maggie
openoffice 5.2 on Windows 10
Re: [Solved] Count number of dates in current month
1000 random dates grouped by year and month and counted by a pivot table (aka data pilot).
https://wiki.openoffice.org/wiki/Docume ... /DataPilot
https://wiki.openoffice.org/wiki/Docume ... /DataPilot
- Attachments
-
- date_pivot.ods
- Nother year/month pivot
- (27.57 KiB) Downloaded 150 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 8
- Joined: Mon Dec 05, 2016 4:34 pm
Re: [Solved] Count number of dates in current month
Thank you Villeroy!
Maggie
Maggie
openoffice 5.2 on Windows 10