# Formula Help

Occasional Contributor

# Formula Help

I need help finding a formula that will take the current month out of others like May for example and then pull all of those dates from that month with the qty only if its not 0 that is associated for that day and put it into another table with the date and qty and update the info if the month has changed.

I am using the 2016 version of excel
thanks anything is appreciated

# Re: Formula Help

Are you limited to having the column with month numbers as the month numbers or adding "helper" columns?

If you're okay with changing the month numbers to dates, you can use the SUMIFS function to accomplish your task.

In your Sheet1, I replaced the values in \$E\$5:\$E\$16 with dates (e.g., 1/31/2021, 2/28/2021, etc)

The I used a combination of SUMIFS and the EOMONTH functions to total the values in column B if the date is column A is between the first day of the month and the date in column E.

This is the formula in \$F\$6 on Sheet1:

``=SUMIFS(\$B\$2:\$B\$23,\$A\$2:\$A\$23,">="&EOMONTH(E5,-1)+1,\$A\$2:\$A\$23,"<="&E5)``

Of course, if you can add a helper column to represent the month number (using the MONTH function), then you can replace most of the SUMIFS with just one criteria

``````=SUMIFS(\$B\$2:\$B\$23,[Range with the number],[Month Number to Match])

=SUMIFS(\$B\$2:\$B\$23,\$C\$2:\$C\$23,E5)``````