I have a Google sheet with a column of dates. I would like to get a total for each month, so that I can see how many of the dates are January, February, March, etc. This formula does not work (Dates is the name of range):
=COUNTIF(Dates,Month=1)
Any help is appreciated.
Following the logic of your proposition, the error is that MONTH() returns an integer, not an array. You can add ARRAYFORMULA() to do the job :
=COUNTIF( ARRAYFORMULA( MONTH( Dates ) ), "=2" )
I finally devised the correct search term for Google help
=sumproduct(month(Dates)=2)
Related
I have a long list of dates in column C with a long list of names in column D.
I need to count how many times a certain name is mentioned but only if the date next to it is today.
So if today's date is 16/11/2022, and I want to find the name "Peter", this formula should return "2".
Column C
Column D
16/11/2022
Peter
16/11/2022
Peter
17/11/2022
Peter
Any ideas? Thanks!
use:
=COUNTIFS(C:C; TODAY(); D:D; "Peter")
update:
=INDEX(COUNTIFS(INT(C:C), TODAY(), D:D, "Peter"))
I have a personal finances Google Sheet with all my expenditures (column A) and corresponding dates (column B) of the month when they are due to be paid.
I would like to create a formula that shows me what is left for the remainder of the month depending on what day of the month I am looking at the sheet.
Something like, ifDate is today, sum all remaining dates of the month expenses.
TIA
Use this formula it works even if the dates is disordered.
=SUMIF(C2:C,">"&F2,B2:B)
Update
=SUMIF(D3:D,">"&TODAY(),C3:C)
I have a sheet with these columns:
A (Date): Range of dates for the year
B (Amount): An amount for an expense
D (Month): Name of each month in the year (e.g. June, July, etc)
I've tried this as suggested to work in other posts:
=SUMPRODUCT(B:B, ISDATE(A:A)*MONTH(A:A)=MONTH(D3&1))
I get the error Function MONTH parameter 1 expects number values. But 'Date' is a text and cannot be coerced to a number. with this.
If I remove the header, I just get a 0 for the sum for each month, which is incorrect.
How do I get this to work for each month the way my sheet is setup?
What the sheet currently looks like:
https://docs.google.com/spreadsheets/d/1_8DQTa9aXGjvd7twL6RZMcFyqxa4Sg7eVTcD2wDXH2A/edit?usp=sharing
Try this instead. Not sure where you got that other formula:
=SUMPRODUCT(B:B,TEXT(A:A,"mmmm")=D3)
use:
=ARRAYFORMULA(IFNA(VLOOKUP(MONTH(D3:D10&1),
QUERY(A2:B, "select month(A)+1,sum(B) group by month(A)"), 2, )))
Use this
=IF(D3="",,IFERROR(SUM(FILTER($B$2:$B,MONTH($A$2:$A&1)=MONTH(D3&1))),""))
Google Sheets: I checked my column of dates is in DATE format not Automatic.
When I use MONTH in a cell I get the correct month back from that column.
When I do a QUERY such as =query('Main'!A1:M20,"select MONTH(M)",1) I get #VALUE! with the comment:
Unable to parse the Function QUERY for parameter 2: Can't perform the function MONTH on a column that is not a DATE or a DATETIME column
Why does QUERY not see the column as being in DATE format but =MONTH does?
months in a query are numbered and starts from 0, therefore, you will need to add +1 to get the first month and then do a weird logic: "where month1=month2" to get february (month(A)+1=3 for march, month(A)+1=12 for december, etc.)
=QUERY(A1:D10, "select A,B,C,D where month(A)+1=2", 1)
Column A contains Datevalues.
Column B a String.
I would like to count all cells where A is this month and B contains a certain String.
Here is my approach: =COUNTIFS(B1:B; "Certain String"; MONTH(A1:A); MONTH(TODAY()))
Unfortunately this approach does not work. Any idea?
=COUNTIFS(B:B;"Certain String";A:A;">"&eomonth(Today();-1);A:A;"<="&eomonth(Today();0))
Does not count this month in other than this year.
=ARRAYFORMULA(COUNTIFS(B:B, "string", MONTH(A:A), "="&MONTH(TODAY())))