Vlookup for data (yield only numeric values)

AlGuy

New Member
Joined
Mar 1, 2012
Messages
37
I am working on a spreadsheet and need to automate data reporting. I update the spreadsheet with data on a daily basis.

Consider the table below:

AB
1
2Wednesday, December 26, 20126300
3Thursday, December 27, 2012NC
4Friday, December 28, 2012NC
5Monday, December 31, 20126200
6Wednesday, January 02, 2013NC
7Thursday, January 03, 20136080
8Friday, January 04, 20136090
9Monday, January 07, 2013NC

<tbody>
</tbody>

I want to get the last 2 Fridays' value. And in case the value of a Friday is not a numeric value (so the cell contains "NC"), the formula should take the closest value going up. In the example below, the formula should yield:
- for the most recent Friday (January 4 2013): 6090 (A basic vlookup formula should work fine here: In B1, I add the date and use the formula: VLOOKUP($B$1,Cours!$1:$1048576,2,FALSE)).
- for the Friday before the most recent: 6300 (The value for that Friday is NC, but since it's not a number, the formula should look for the most recent numeric value which occurred on December 26, 2012). The previous formula would have return "NC", which is not helpful for my calculations.

Thank you to anyone who can help me with solving this issue.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

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