Date & Quarters

raheem

New Member
Joined
Apr 24, 2017
Messages
30
Hi,

I need a simple formula to get the quarter number from date. In below table, if column A is already date, it should mention the quarter in column B. But if column A is already quarter, it should simply equal in column B. Changing date format is not an option. I tried to create a formula with IF+MONTH+SWITCH etc. but it becomes too complex to understand for other users.

AB
01.01.2018Q1
05.02.2018Q1
10.03.2019Q1
03.04.2019Q2
31.05.2018Q2
Q2Q2
Q2Q2
Q3Q3
Q3Q3
Q4Q4
Q4Q4

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,405
Office Version
365
Platform
Windows
Hi, you could try:

=IF(ISNUMBER(A2),"Q"&ROUNDUP(MONTH(A2)/3,0),A2)
 

raheem

New Member
Joined
Apr 24, 2017
Messages
30
Hi, you could try:

=IF(ISNUMBER(A2),"Q"&ROUNDUP(MONTH(A2)/3,0),A2)
Doesn't work. Probably because ISNUMBER returns FALSE as the input is having two dots (01.01.2018 not recognized as number)
Also, there is no standard date format in A2, so how can MONTH(A2) identify a month out of A2.
 
Last edited:

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,405
Office Version
365
Platform
Windows
Doesn't work. Probably because ISNUMBER returns FALSE
Hi, it wasn't clear that your dates were text and not real excel date serial numbers.

I would probably advise converting your text dates to real dates - but here is an alternative you can try.

=IF(LEFT(A2)="Q",A2,"Q"&ROUNDUP(MID(A2,4,2)/3,0))
 
Last edited:

Phuoc

Board Regular
Joined
Apr 29, 2016
Messages
189
he input is having two dots (01.01.2018 not recognized as number)
One way:

=IF(COUNTIF(A2,"??.??.????"),"Q"&ROUNDUP(MID(A2,4,2)/3,0),A2)
 

raheem

New Member
Joined
Apr 24, 2017
Messages
30
As I said in start, changing format is not an option. But the alternative is also fine.

Thanks
 

raheem

New Member
Joined
Apr 24, 2017
Messages
30
Hi, it wasn't clear that your dates were text and not real excel date serial numbers.

I would probably advise converting your text dates to real dates - but here is an alternative you can try.

=IF(LEFT(A2)="Q",A2,"Q"&ROUNDUP(MID(A2,4,2)/3,0))
As I said in start, changing format is not an option. But the alternative is also fine.

Thanks
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
797
FormR was not asking you to change the format. He was asking you to supply dates as real dates, not text looking like dates.
If they were real dates, they could still look like 10.01.2019, then ISNUMBER would work.
 

Mr_Lucky

New Member
Joined
Jul 31, 2019
Messages
24
Hi, I am using this formula ="Q" & ROUNDUP(MONTH(A2)/3,0) & " "&year(A2). However some of the cells in A2 are blank and the value Q1 1900 is returned instead of blank. I have tried to add IFERROR but is till returning Q1 1900.

ABB
1DatesQuartersExpected result
2Q1 1900Blank
330/09/2019Q3 2019Q3 2019

<tbody>
</tbody>


I would really appreciate any help with this issue
 

mse330

Well-known Member
Joined
Oct 18, 2007
Messages
633
Office Version
365
Platform
Windows
Hi, I am using this formula ="Q" & ROUNDUP(MONTH(A2)/3,0) & " "&year(A2). However some of the cells in A2 are blank and the value Q1 1900 is returned instead of blank. I have tried to add IFERROR but is till returning Q1 1900.

I would really appreciate any help with this issue
How about this

=IF(ISBLANK(A2),"","Q"&ROUNDUP(MONTH(A2)/3,0)&" "&YEAR(A2))
 

Watch MrExcel Video

Forum statistics

Threads
1,098,859
Messages
5,465,111
Members
406,412
Latest member
superjoejoe

This Week's Hot Topics

Top