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

mezzopiano1423

New Member
Joined
Feb 12, 2013
Messages
10
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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
There might be a better way to do this, but this works on a test sheet I did:

MonthQuarter
JanQ1
FebQ1
MarQ1
AprQ2
MayQ2
JunQ2
JulQ3
AugQ3
SepQ3
OctQ4
NovQ4
DecQ4

<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.
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,819
Members
449,469
Latest member
Kingwi11y

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top