Need to return first non-blank cell based in one column on a date in another column.

excelcpa95

New Member
Joined
Feb 7, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet that has a bunch of exchange rates with dates in Column A (most recent date at the top) and exchange rates in the rest of the columns.

I previously used INDEX/MATCH to look up exchange rates on specific dates or the average of exchange rates over a date range. Unfortunately, I have recently integrated some currencies that do not have an exchange rate value for every date, but has a handful of blank cells. I want to lookup so that if the specific date I am looking up is blank, it will return the next non-blank value for the most recent date with a value prior to the date that has a blank cell.

Under my current formulas, I use the array as my INDEX reference, and MATCH Functions using the Date as the Row_Num and Currency as the Column_Num.

How would I be able to accomplish this?
 

Attachments

  • FX Lookup.png
    FX Lookup.png
    45.8 KB · Views: 28

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi Excelcpa95,

As long as your dates remain in latest first sequence then this should work.

Excelcpa95.xlsx
ABCDEFGH
1FX RateDate=19-Dec-21Currency=Argentine Blue Dollar
2DateColombian PesoArgentine Blue Dollar
331-Dec-213000.00Result=246.24
430-Dec-213060.00
529-Dec-213121.20210.16
628-Dec-213183.62214.36
727-Dec-21218.65
826-Dec-21223.02
925-Dec-21
1024-Dec-213446.06
1123-Dec-213514.98
1222-Dec-213585.28241.41
1321-Dec-213656.98246.24
1420-Dec-21
1519-Dec-21
1618-Dec-213880.82261.31
1717-Dec-213958.44266.53
1816-Dec-214037.61271.87
Sheet1
Cell Formulas
RangeFormula
F3F3=INDEX($B$3:$C$18,AGGREGATE(14,6,ROW($A$3:$A$18)-ROW($A$2)/(($A$3:$A$18>=$F$1)*($B$2:$C$2=$H$1)*($B$3:$C$18<>"")),1),MATCH($H$1,$B$2:$C$2,0))
 
Upvote 0
i used a named range for the dates
Map1
BCDEF
1
202/05/20221006
302/08/2022109602/04/20221047
402/07/2022106202/03/20221047
502/06/2022102402/02/20221047
602/05/2022100602/01/20221047
702/04/202201/31/20221047
802/03/202201/30/20221047
902/02/202201/29/20221040
1002/01/202201/28/20221012
1101/31/202201/27/20221004
1201/30/2022104701/26/20221068
1301/29/2022104001/25/20221089
1401/28/2022101201/24/20221089
1501/27/2022100401/23/20221089
1601/26/2022106801/22/20221089
1701/25/2022
1801/24/2022
1901/23/2022
2001/22/2022
2101/21/2022
2201/20/20221089
2301/19/20221076
2401/18/20221040
2501/17/20221099
2601/16/20221022
2701/15/2022
28
29
Blad1
Cell Formulas
RangeFormula
F2:F16F2=VLOOKUP(MAX((MyDates<=E2)*(OFFSET(MyDates,,1,,)<>"")*MyDates),OFFSET(MyDates,,,,2),2,0)
E3:E16E3=+E2-1
Named Ranges
NameRefers ToCells
MyDates=Blad1!$B$3:$B$27F2:F16
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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