Find Non-Blank Cell

ljybrcd

New Member
Joined
Sep 3, 2018
Messages
6
I have read some of the other posts, but can't seem to get the suggested formulas to work right. I've tried using vlookup, isblank, index/match, etc.

I have a summary sheet in one tab where I want to lookup a tank number in the first column and get the first non-blank result for that tank number in a column from a table in the second tab.

The First tab is a list of results for each Tank number (Tank in column A, results in columns B and C).
The Second tab is all the results in a large table of data like the example below.
So, I want excel to retrieve the "14.1" result in the "code 1" column for all the rows that match Tank "L001".

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]tank[/TD]
[TD]code 1[/TD]
[TD]code 2[/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD][/TD]
[TD]15.2[/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD][/TD]
[TD]15.5[/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]14.1[/TD]
[TD]15.7[/TD]
[/TR]
</tbody>[/TABLE]

Thanks!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
No, sorry that did not work. My index range is on sheet #2 D2:AV1300, with the Tank number in column d and results in columns E thru AV. The formula and lookup value for the Tank number is on sheet #1 in column A. I adjusted for formula but got an "REF" error result"
{=[TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]INDEX('Lab eport'!$D$1:$AV$1300,MATCH(A:A,IF('Lab Report'!$D$1:$AV$1300="","",A:A),0))[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
[TABLE="width: 425"]
<colgroup><col><col><col span="4"></colgroup><tbody>[TR]
[TD]TANK[/TD]
[TD]OpCode[/TD]
[TD]Alc NIR[/TD]
[TD]Alc GC[/TD]
[TD]TA[/TD]
[TD]pH[/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]Post Job Check[/TD]
[TD][/TD]
[TD][/TD]
[TD]0.58[/TD]
[TD]3.69[/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]Post Job Check[/TD]
[TD][/TD]
[TD][/TD]
[TD]0.58[/TD]
[TD]3.69[/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]Post Job Check[/TD]
[TD]14.37[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]Post Job Check[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]Post Job Check[/TD]
[TD]14.38[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]L001[/TD]
[TD]Post Job Check[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Here is a portion of columns D-I. Thanks for your help!
 
Upvote 0

Book1
ABCDEFGHIJKL
1TANKOpCodeAlc NIRAlc GCTApHAlc NIRAlc GCTApH
2L001Post Job Check0.583.69L00114.370.583.69
3L001Post Job Check0.583.69
4L001Post Job Check14.37
5L001Post Job Check
6L001Post Job Check14.38
7L001Post Job Check
Sheet1


In I2 control+shift+enter, not just enter, and copy across:

=IFERROR(INDEX($C$2:$F$7,MATCH(1,IF($A$2:$A$7=$H2,IF(INDEX($C$2:$F$7,0,MATCH(I$1,$C$1:$F$1,0))<>"",1)),0),MATCH(I$1,$C$1:$F$1,0)),"")
 
Upvote 0
Ok, I see how that works with the set up shown above. But if I edit the formula to include 2000 rows of data (ex: $c$2:$f$2000, instead of the 2 instances of $c$2:$f$7) then the formula shows blank. What would cause that?
 
Upvote 0
Ok, I see how that works with the set up shown above. But if I edit the formula to include 2000 rows of data (ex: $c$2:$f$2000, instead of the 2 instances of $c$2:$f$7) then the formula shows blank. What would cause that?

When we edit such a formula, we again need to confirm the formula with control+shift+enter.
 
Upvote 0
Oops, rookie move, thanks! Okay, so I have edited the formula to include all rows of the Lab Report data in the relevant columns. But now it only seems to show the result for anything in the Tank column that is blank, vs "L001" in the Tank column. Here's the formula I edited:
{=IFERROR(INDEX('Lab Report'!$F:$AV,MATCH(1,IF('Lab Report'!$D:$D=$A:$A,IF(INDEX('Lab Report'!$F:$AV,0,MATCH('Lab Report'!F$1,'Lab Report'!$F$1:$AV$1,0))<>"",1)),0),MATCH('Lab Report'!F$1,'Lab Report'!$F$1:$AV$1,0)),"")}

Just a reminder that my formula is on a separate sheet from the data in the Lab Report. The Lab Report table starts in column D containing the Tank IDs, but the Tank ID on the summary sheet is in column A.
 
Upvote 0
The data sheet: Lab Report
The formula sheet: Sheet1


Book1
ABCDE
1Alc NIRAlc GCTApH
2L00114.370.583.69
Sheet1


In B2 control+shift+enter, not just enter, and copy across:

=INDEX('Lab Report'!$F:$AV,MATCH(1,IF('Lab Report'!$D:$D=$A2,IF(INDEX('Lab Report'!$F:$AV,0,MATCH(B$1,'Lab Report'!$F$1:$AV$1,0))<>"",1)),0),MATCH(B$1,'Lab Report'!$F$1:$AV$1,0))

Note 1. The differences between this and your edit (see post #9 ) are bolded.
Note 2. A best practice is that the whole column references should be avoided for efficiency reasons. The need for such
can be effectively circumvented by having dynamic named ranges.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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