Trying to get month name using a formula

thp510

Board Regular
Joined
Oct 19, 2015
Messages
110
Office Version
  1. 365
Platform
  1. Windows
Hello. I have a cell where the month may change based on the calendar quarter found in cell A1. See below.

ABC
1Q1
2JanFebMar

Based on what's in cell A1 (Q1, Q2, Q3, or Q4) I'm looking for the start of the month in that quarter to populate in cell A2. So, in this example, A1 is equal to Q1, therefore cell A2 shows JAN. If, cell A1 showed "Q2", then cell A2 would be April... and so forth. That is the easy part, however I'm trying to figure out how I can write a formula that will auto populate with the 2nd and 3rd months of the specific quarter found in cell B2 and C2. Any advice? I'd like cell B2 and cell C2 to be dynamic based on what's populated in A2 (which is populated based on what's in cell A1). Thanks for your help.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Book2
ABC
1Q1
2JanFebMar
Sheet1
Cell Formulas
RangeFormula
A2A2=DATE(2023,LOOKUP($A$1,{"Q1","Q2","Q3","Q4"},{1,4,7,10}),1)
B2:C2B2=EDATE(A2,1)

A2:C2 are actual date, formatted as "mmm"
 
Upvote 0
If you just want the cells to appear to have that text but are happy for the underlying values to be dates (as is the case with the post 2 suggestion) then you could use the formula in A2. It will "spill" across the other two cells and you would format those cells as "mmm" as described in post 2

If you want the cells to actually be text rather than dates then try the A3 formula. Again it will spill right but you won't have to format the cells.

23 03 06.xlsm
ABC
1Q1
2JanFebMar
3JanFebMar
Months
Cell Formulas
RangeFormula
A2:C2A2=DATE(2023,(RIGHT(A1,1)-1)*3+SEQUENCE(,3),1)
A3:C3A3=TEXT(DATE(2023,(RIGHT(A1,1)-1)*3+SEQUENCE(,3),1),"mmm")
Dynamic array formulas.
 
Upvote 1

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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