Nested IF for Quater between two dates

Chandresh

Board Regular
Joined
Jul 21, 2009
Messages
146
HI all,

need a help on nested if formula for calculating the quarter based on start date and end date

follow is the table

DateResultStartEndOutput
03-10-201701-04-201715-06-2017Q1
16-06-201715-09-2017Q2
16-09-201715-12-2017Q3
16-12-201715-03-2018Q4
16-03-201831-03-2018Q5

<colgroup><col><col><col span="2"><col></colgroup><tbody>
</tbody>
column A is the date for which I need quarter in column B.

Example 03-10-2017 comes between 16-09-2017(start date) and 15-12-2017(end date) then my result in column B should be Q3.

Thanks
Chandresh
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What if you start date and end span two quarters?, i.e.
Start Date: 15-03-2018
End Date: 14-04-2018

What would you want to return in that instance?

Also, I see that you have Q5, instead of starting over at Q1.
Does that mean that you have one initial start date for the very first quarter, and for subsequent years, instead of starting over with Q1, you are going to keep incrementing?
That would seem to imply that 01-01-2017 is your initial start date, and you would never have any dates less than that. Is that correct?
 
Upvote 0
DateResultStartEndOutput
03-10-201701-04-201715-06-2017Q1
16-06-201715-09-2017Q2
16-09-201715-12-2017Q3
16-12-201715-03-2018Q4
16-03-201831-03-2018Q5

<tbody>
</tbody>

My start date and end date is constant for each Quarter Example : 01-04-2017 to 15-06-2107 is my Q1, 16-06-2017 to 15-09-2017 is my Q2.

so whatever date comes in between this dates will fall in that bracket.
 
Upvote 0
Sorry, I totally misread your question.

What you want can be done pretty easily using VLOOKUP. Just set up a three column table with Start Date, End Date, and Output, like you have shown above.
For simplicity sake, we can then make this a named range (see: https://www.contextures.com/xlNames01.html). Let's name it "MyDates".

Now, let's say that you have a date in cell A2, and what to see which quarter it falls in. Use this formula:
Code:
=VLOOKUP(A2,MyDates,3,True)
 
Upvote 0
Yes I have arranged the data and used =VLOOKUP(A1,$C$1:$D$5,2,TRUE) its working

01-04-2017Q101-04-2017Q1
16-06-2017Q2
16-09-2017Q3
16-12-2017Q4
16-03-2018Q5

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

thanks for your help
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,506
Members
449,089
Latest member
RandomExceller01

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