Excel nested month formula

DeepuSultan

New Member
Joined
Feb 18, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
I have this formula for two months, and need to extend it for 12 months. It's already long, how to shorten it for 12 months?

The values are stored in separate tabs e.g. "Jan 24 Rate"

=IF(D1="","N/A",IF(MONTH(D1)=1,IF(G1="USD",O1,O1/VLOOKUP(G1,'Jan 24 Rate'!$B$2:$C$128,2,0)),IF(MONTH(D1)=2,IF(G1="USD",O1,O1/VLOOKUP(G1,'Feb 24 Rate'!$B$2:$C$128,2,0)))))
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try this for 12 months:

=IF(D1="","N/A",IF(G1="USD",O1,O1/VLOOKUP(G1,INDIRECT("'"&TEXT(D1,"mmm")&" 24 Rate'!$B$2:$C$128"),2,0)))
 
Upvote 1
Solution
Try this for 12 months:

=IF(D1="","N/A",IF(G1="USD",O1,O1/VLOOKUP(G1,INDIRECT("'"&TEXT(D1,"mmm")&" 24 Rate'!$B$2:$C$128"),2,0)))
Note that the valus will be in multiple tabs and I need to pull values from it. These are the tab names Jan 24 Rate, Feb 24 Rate and so on. I will add the sheets till Dec and need to pull values from each sheet based on the number of the month.
 
Upvote 0
Note that the valus will be in multiple tabs and I need to pull values from it. These are the tab names Jan 24 Rate, Feb 24 Rate and so on. I will add the sheets till Dec and need to pull values from each sheet based on the number of the month.
How to incorporate these in your formula?
 
Upvote 0
The formula Phuoc posted does what you want. Did you try it?
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

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