dwirony
dwirony

Reputation: 5450

Struggling with a nested if function with multiple conditions

Struggling with this nested if. I just want it to return the true condition if any of the three are found in the cell (Jan, Feb or Mar returns "Q1", etc.). Right now it's just return 0 for whatever I have in the cell... Do I need to use OR?

=IF(D2 ="Jan,Feb,Mar", "Q1", IF(D2="Apr,May,Jun", "Q2", IF(D2="Jul,Aug,Sep", "Q3", IF(D2="Oct,Nov,Dec", "Q4",0))))

Upvotes: 0

Views: 25

Answers (1)

Scott Craner
Scott Craner

Reputation: 152660

Use this formula:

="Q" & INT((MONTH(--(D2 & " 1, 2017"))-1)/3)+1

Upvotes: 2

Related Questions