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?
 
And that bit does not return #N/A?

If you changed the formula in any way, let's how it looks.


=INDEX('Std Values'!$C$3:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$E$1:$CG$1,0))

This is what I have now... substituted the Worksheets with the appropriate name change....

When I go into the actual function Arguments - It shows the Row_Num = N/A; Now the Column_Num is correct for the output.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
=INDEX('Std Values'!$C$3:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$E$1:$CG$1,0))

This is what I have now... substituted the Worksheets with the appropriate name change....

This back and forth is consuming too much attention... and is prone to making mistakes.

When I go into the actual function Arguments - It shows the Row_Num = N/A; Now the Column_Num is correct for the output.

Do we have #N/A here: Yes or No?

Also, note the bold part...

=INDEX('Std Values'!$C$3:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$C$1:$CG$1,0))
 
Upvote 0
This back and forth is consuming too much attention... and is prone to making mistakes.



Do we have #N/A here: Yes or No?

Also, note the bold part...

=INDEX('Std Values'!$C$3:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$C$1:$CG$1,0))


Yes, we have "#N/A" here.
 
Upvote 0
The formula must be:

=INDEX('Std Values'!$C$3:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$C$1:$CG$1,0))


It is still populating as #N/A.

I verified both the format of the date and the actual reference point in Std Value Sheet.
 
Upvote 0
What is the value in A115?

What is the value in G115?

What does this

=MATCH($G115,'Std Values'!$C$1:$CG$1,0)

return?


The value of A115 = 37894560

G115 = 1/12 (this is the format of 1/1/12). I used the custom date format for this column.

The output for
=MATCH($G115,'Std Values'!$C$1:$CG$1,0) is equal to 20.
 
Upvote 0
The value of A115 = 37894560

G115 = 1/12 (this is the format of 1/1/12). I used the custom date format for this column.

The output for
=MATCH($G115,'Std Values'!$C$1:$CG$1,0) is equal to 20.

Thanks. Which range must A115 match?


By the way, I notice another issue with your ranges...

=INDEX('Std Values'!$C$2:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$C$1:$CG$1,0))
 
Upvote 0
Thanks. Which range must A115 match?


By the way, I notice another issue with your ranges...

=INDEX('Std Values'!$C$2:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$C$2:$CG$400,0,MATCH($G115,'Std Values'!$C$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$C$1:$CG$1,0))

A115 must match C2:C1500 on STD Value sheet.
 
Upvote 0
A115 must match C2:C1500 on STD Value sheet.

Would you test whether the following edit succeeds?

=INDEX('Std Values'!$D$2:$CG$400,MATCH(1,IF('Std Values'!$C$2:$C$400=$A115,IF(ISNUMBER(1/INDEX('Std Values'!$D$2:$CG$400,0,MATCH($G115,'Std Values'!$D$1:$CG$1,0))),1)),0),MATCH($G115,'Std Values'!$D$1:$CG$1,0))
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
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