How can I use the IF function in Google Sheets to make a decision based on the current month?

The IF function in Google Sheets is a powerful tool that allows users to make decisions based on specific criteria. This function can be used to create a logical statement that evaluates whether a certain condition is true or false. In the context of the current month, the IF function can be used to make decisions and perform different actions based on the month that is currently displayed in a specific cell. This feature can be particularly useful for organizing and analyzing data, as well as automating certain tasks in a spreadsheet. By utilizing the IF function, users can effectively manage and manipulate data based on the current month, making their work in Google Sheets more efficient and accurate.

Google Sheets: Use IF Function Based on Month


You can use the following formula to use an IF function based on a month in Google Sheets:

=IF(MONTH(A2)=10, B2, 0)

This particular formula checks if the month in the date of cell A2 is equal to 10 (the 10th month of the year), which is October.

If the month is October, then the formula returns the value in cell B2.

Otherwise, the formula simply returns a value of 0.

The following example shows how to use this formula in practice.

Example: Use IF Function Based on Month in Google Sheets

Suppose we have the following dataset in Google Sheets that shows the total sales made on various dates at some store:

Suppose we would like to use an IF function that returns the value of the sales if the date in column A is in October or a value of zero if the date is not in October.

We can type the following formula into cell C2 to do so:

=IF(MONTH(A2)=10, B2, 0)

The following screenshot shows how to use this formula in practice:

Google Sheets If month

If the date in column A is in October, then the formula returns the corresponding value in the sales column.

Otherwise, the formula simply returns a value of zero.

Note that you can also use multiple conditions within the IF function.

=IF(OR(MONTH(A2)=10, MONTH(A2)=11), B2, 0)

The following screenshot shows how to use this formula in practice:

If the date in column A is in October or November, then the formula returns the corresponding value in the sales column.

Otherwise, the formula simply returns a value of zero.

Additional Resources

The following tutorials explain how to perform other common tasks in Google Sheets:

x