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".

tankcode 1code 2
L00115.2
L00115.5
L00114.115.7

<tbody>
</tbody>

Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Confirm with Control+Shift+Enter

=INDEX(B2:B4,MATCH("L001",IF(B2:B4="","",A2:A4),0))
 
Upvote 0
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"
{=
INDEX('Lab eport'!$D$1:$AV$1300,MATCH(A:A,IF('Lab Report'!$D$1:$AV$1300="","",A:A),0))

<tbody>
</tbody>
 
Upvote 0
TANKOpCodeAlc NIRAlc GCTApH
L001Post Job Check0.583.69
L001Post Job Check0.583.69
L001Post Job Check14.37
L001Post Job Check
L001Post Job Check14.38
L001Post Job Check

<colgroup><col><col><col span="4"></colgroup><tbody>
</tbody>

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,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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