Finding 1st value in row if prior cells in the row are blank

NotaVBAeXpert

New Member
Joined
May 4, 2018
Messages
26
Hi,

I am trying to find the amount located in specific cell based on month/year(x/xx). I have multiple worksheets; the first worksheet showing what value to look up and the specific date, for example... I need to lookup value 454839 on 1/13(January 2013).

My 2nd worksheet shows the data with the lookup values going down Column A and the dates across the columns in the 1st row.

I currently have a vlookup and match function:

(
=VLOOKUP(A30,'Std Values'!C:CG,MATCH('Non-Std Calc '!G30,Sheet5!$C$1:$CG$1,0),FALSE)

But I need help figuring out a macro or formula if the output from my above formual is blank.because there is a value in those cells. I would need the next value in that particualr row which would match the value in the row.Any ideas?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
A30 would not repeat.

Then I don't understand what this remark of yours mean: "
But I need help figuring out a macro or formula if the output from my above formual is blank.because there is a value in those cells. I would need the next value in that particualr row which would match the value in the row."​
 
Last edited:
Upvote 0
Then I don't understand what this remark of yours mean: "
But I need help figuring out a macro or formula if the output from my above formual is blank.because there is a value in those cells. I would need the next value in that particualr row which would match the value in the row."​


Just to clarify,

I have two worksheets, Sheet 1 and Sheet 2.

Sheet 1 will show my formulas and starting value for my project.

Sheet 2 includes the core data in which the top row shows the dates (i.e. 1/11 through 1/17) and the first column has the reference number which is also on sheet 1.

I currently have a formula which is using the index and the match function to match the date for the specific reference column.

=INDEX('Sheet2'!A:CG,MATCH($A64,'Sheet2'!$C:$C,0),MATCH('Sheet1 '!$G64,'Sheet2'!$1:$1,0)*MATCH('Sheet1 '!$G64,'Sheet2'!$1:$1,-1))

Now if there isn't a populated cell in in the initial formula output, I would then need the next value in that particular row.

The reference column in Sheet 1/Sheet 2 do not repeat.
 
Upvote 0
Let me clarify...

Does $A64 occur more than once in 'Sheet2'!$C:$C?

If one occurrence has a corresponding blank in the return range, then it's possible to go the occurrence which has a corresponding non-blank (numeric) value in the return range.
 
Last edited:
Upvote 0
Let me clarify...

Does $A64 occur more than once in 'Sheet2'!$C:$C?

If one occurrence has a corresponding blank in the return range, then it's possible to go the occurrence which has a corresponding non-blank (numeric) value in the return range.


Ok, It would occur more than once on Sheet2.
 
Upvote 0
Ok, It would occur more than once on Sheet2.
This should work. Control+shift+enter in B64 of Sheet1, not just enter:
Rich (BB code):
=INDEX(Sheet2!$C$2:$CG$1500,MATCH(1,IF(Sheet2!$C$2:$C$1500=$A64, IF(ISNUMBER(1/INDEX(Sheet2!$C$2:$CG$1500,0,MATCH($G64,Sheet2!$C$1:$CG$1,0))),1)),0), MATCH($G64,Sheet2!$C$1:$CG$1,0))

 
Upvote 0
This should work. Control+shift+enter in B64 of Sheet1, not just enter:
Rich (BB code):
=INDEX(Sheet2!$C$2:$CG$1500,MATCH(1,IF(Sheet2!$C$2:$C$1500=$A64, IF(ISNUMBER(1/INDEX(Sheet2!$C$2:$CG$1500,0,MATCH($G64,Sheet2!$C$1:$CG$1,0))),1)),0), MATCH($G64,Sheet2!$C$1:$CG$1,0))



Would there be a reason why I am getting an "N/A" Error?
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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