# Using nested IF to assign a quarter to a month - multiple conditions?

#### mezzopiano1423

##### New Member
I am trying to create a formula that will assign the quarter of the calendar year from which each month belongs. I have a long list of numeric months (A), and want the output of the formula in (B) to be as follows:

A B
1 Q1
12 Q4
3 Q1
5 Q2 etc.

I would do a Vlookup but I resolved to better understand nested if functions. However, I just can't make them work, no matter how simple I begin.

I tried using OR instead of nesting 3 IF's - that's a good start, right? However, no luck with the following formula. Also, I stopped at Q2 so I could troubleshoot if needed, surprise surprise:

=IF(OR(B2="Jan","Feb","Mar"),"Q1",IF(OR(B2="Apr","May","Jun"),"Q2",""))

Is the problem here that I am testing multiple conditions?

Condition 1 = if the month is jan, feb mar, the result is Q1 ELSE
condition 2 = if the month is apr, may, jun, the result is Q2 ELSE
and so on

Any input is greatly appreciated. Thank you,

PSR

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.
="q"&roundup(a1/3,0)

There might be a better way to do this, but this works on a test sheet I did:

 Month Quarter Jan Q1 Feb Q1 Mar Q1 Apr Q2 May Q2 Jun Q2 Jul Q3 Aug Q3 Sep Q3 Oct Q4 Nov Q4 Dec Q4

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

Formula in B2: =IF(OR(A2={"Jan","Feb","Mar"}),"Q1",IF(OR(A2={"Apr","May","Jun"}),"Q2",IF(OR(A2={"Jul","Aug","Sep"}),"Q3",IF(OR(A2={"Oct","Nov","Dec"}),"Q4,"""))))

Copy down as necessary.

Thank you both!

Replies
3
Views
187
Replies
20
Views
624
Replies
5
Views
275
Replies
2
Views
214
Replies
6
Views
223

1,203,604
Messages
6,056,225
Members
444,852
Latest member
MJaspering

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back