Lookup formula

mattbird

Active Member
Joined
Oct 15, 2013
Messages
305
Office Version
  1. 2016
Hi,

I’m currently using the following formula excel 2016 (in cell G7) to identify what quarter a date fall into:

=IF($F7=“”,”NA”,(LOOKUP(MONTH($F7),{1,4,7,10},{“Q4”,”Q1”,”Q2”,”Q3”})))

For example:

1 Jan - end Mar = Q4
1 Apr - end Jun = Q1
1 Jul - end Sep = Q2
1 Oct - end Dec = Q3

How can I adapt the formula to also return the year ie

Date entered (cell F7): 01/04/23
Answer (cell G7): Q1 - 2023

Or

Date entered (cell F7): 01/04/24
Answer (cell G7): Q1 - 2024

And so on etc.

Any help is greatly appreciated.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=IF($F7="","NA",LOOKUP(MONTH($F7),{1,4,7,10},{"Q4","Q1","Q2","Q3"})&"-"&YEAR($F7))
 
Upvote 0
Solution
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=IF($F7="","NA",LOOKUP(MONTH($F7),{1,4,7,10},{"Q4","Q1","Q2","Q3"})&"-"&YEAR($F7))
Worked perfectly, thanks.
 
Upvote 0
You're welcome & thanks for the feedback.

Thanks also for updating your profile.
 
Upvote 0

Forum statistics

Threads
1,215,510
Messages
6,125,237
Members
449,217
Latest member
Trystel

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