# Need a formula for month only

Copper Contributor

# Need a formula for month only

Good day, I am attempting to use one column to do 2 different functions I think. So I'm coming to the experts :)

OK, so I need a column that is a date (Ex., A2= 06/07/2023). It should be a date because elsewhere this is used to calculate -90 days.

Here's the rub: in ANOTHER place I need this to be added to all the other totals from that month (June in this case) ONLY. AND this needs to not be affected by year as this will be a rolling totals and each year will have different numbers.

I might be going about this wrong (in fact I'm sure of it) so I included a simplified workbook with the blocks and layout I'm going for. Thanks again for any and all help!

4 Replies

# Re: Need a formula for month only

Sheet1 has some rows with 2022 in the Year column, but a date in 2023 in the Day/Month column. Is that intentional? If so, how should we treat those dates?

# Re: Need a formula for month only

Perhaps

``````=SUMIFS(
Sheet1!\$C\$3:\$C\$7,
Sheet1!\$B\$3:\$B\$7, "<=" & EOMONTH(DATE(B\$2, MONTH(1 & \$A3), 1), 0),
Sheet1!\$B\$3:\$B\$7, ">=" & EOMONTH(DATE(B\$2, MONTH(1 & \$A3), 1), 0) - 90
)``````

if to enter days as full ones

# Re: Need a formula for month only

That was not intentional, but as I didn't manually put in the year it makes sense that it autofills it. This could be the start of where I'm going wrong. If I fix that then what should the next part to auto-sort on sheet2 be?

# Re: Need a formula for month only

See the reply by @Sergei Baklan