Findind the correct Line and later finding all non blank value.

waiT_

New Member
Joined
Jun 22, 2015
Messages
8
Hi, I am looking for something that can replace A3 and A4~A5 formulas, and be used in a table if way more columns compared to the example.

What it needs to do is Look for the LINE A1 is in the table, and then return the first non blank occurance header on a3, in a4 it will give the second non blank occurance in the line... and so on. b3,b4... Would return the Actual value, and for that I use =IFERROR(VLOOKUP(A1;TABLE;MATCH(A4;TABLE[#Headers];0));"")

Name1
NameColumn1Column2Column3Column4
Column2
XXName1XXYY
Column4YYName2ZZ

<tbody>
</tbody>


Formula on A3
=IF(VLOOKUP(A1;TABLE;1;0)>0;TABLE[[#Headers];[Column1]];IF(VLOOKUP(A1;TABLE;2;0)>0;TABLE[[#Headers];[Column2]];IF(VLOOKUP(A1;TABLE;3;0)>0;TABLE[[#Headers];[Column3]];IF(VLOOKUP(A1;TABLE;4;0)>0;TABLE[[#Headers];[Column4]];""))))

Formula on A4
=IFERROR(IF((A1;TABLE;(MATCH(A3;TABLE[#Headers];0)+1))>0;VLOOKUP(A3;TABLE[#Headers];(MATCH(A3;TABLE[#Headers];0)+1);1);,IF(VLOOKUP(A3;TABLE[#Headers];(MATCH(A3;TABLE[#Headers];0)+2))>0;VLOOKUP(A3;TABLE[#Headers];(MATCH(A3;TABLE[#Headers];1)+2);1);IF(VLOOKUP(A3;TABLE;(MATCH(A3;TABLE[#Headers];1)+3);1)>0;VLOOKUP(A3;TABLE[#Headers];(MATCH(A3;TABLE[#Headers];1)+3);1);"")));"")

Formula on A5
=IFERROR(IF((A1;TABLE;(MATCH(A3;TABLE[#Headers];0)+1))>0;VLOOKUP(A4;TABLE[#Headers];(MATCH(A4;TABLE[#Headers];0)+1);1);,IF(VLOOKUP(A4;TABLE[#Headers];(MATCH(A4;TABLE[#Headers];0)+2))>0;VLOOKUP(A4;TABLE[#Headers];(MATCH(A4;TABLE[#Headers];1)+2);1);IF(VLOOKUP(A4;TABLE;(MATCH(A4;TABLE[#Headers];1)+3);1)>0;VLOOKUP(A4;TABLE[#Headers];(MATCH(A4;TABLE[#Headers];1)+3);1);"")));"")

Sorry for the format, Its my first post and my english is rusty.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Since I dont know much about formating here and I cant attach my own excel file, I will tyr my best.

This would be the table with my data

NameValue1Value2Value3Value4Value5
Jorge$10$5
Antony$8$3$5$9$19
Maria$12$5
Potato$5

<tbody>
</tbody>

In another sheet, I would have a place to select a Name from the Name Column

Name to Search
Maria

<tbody>
</tbody>

And with that Name these results would appear(The values and its headers of the Line Maria is IN)

Value2$12
Value4$5

<tbody>
</tbody>

If I changed the Name Like this.

Name to Search
Potato

<tbody>
</tbody>

I would get

Value5$5

<tbody>
</tbody>

Changing Again

Name to Search
Antony

<tbody>
</tbody>

Output

Value1$8
Value2$3
Value3$5
Value4$9
Value5$19

<tbody>
</tbody>

And so on... For unlimited amount of columns.

Thank you in advance. I hope I was capable of explaining what I want to achieve.

I saw your function for the 1st occurance.

=INDEX(B3:IV3,MATCH(1,INDEX(1-ISBLANK(B3:IV3),1,0),0))

And made it work for the 1st value.
But I am not smart enough to get the rest without making a big and limited function.
Thanks again.
 
Upvote 0
Your original post contains an indication that the data you have is in an Excel Table. What follows follows this...

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
1​
NameValue1Value2Value3Value4Value5name to searchmaria
2​
Jorge
$10​
$5​
count
2​
3​
Antony
$8​
$3​
$5​
$9​
$19​
idxheadervalue
4​
Maria
$12​
$5​
3​
Value2
$12​
5​
Potato
$5​
5​
Value4
$5​

<tbody>
</tbody>


A:F contains Table1, created with Insert | Table.

I2, just enter:
Rich (BB code):

=COUNT(INDEX(Table1,MATCH(I1,Table1[Name],0),0))

H4, control+shift+enter, not just enter, and copy down:
Rich (BB code):

=IF(ROWS($H$4:H4)<=$I$2,
  SMALL(IF(ISNUMBER(INDEX(Table1,MATCH($I$1,Table1[Name],0),0)),
  COLUMN(Table1[#Headers])-MIN(COLUMN(Table1[#Headers]))+1),ROWS($H$4:H4)),"")

I4, just enter and copy down:
Rich (BB code):

=IF(H4="","",INDEX(Table1[#Headers],H4))

J4, just enter and copy down:
Rich (BB code):

=IF(H4="","",INDEX(Table1,MATCH($I$1,Table1[Name],0),H4))

See the workbook that implements the foregoing: https://dl.dropboxusercontent.com/u...ne and later finding all non blank value.xlsx
 
Last edited:
Upvote 0
Wow, this is what I am looking for.
Since it is for someone else to use it, it would be nice if it was possible to not use the auxiliary column "idx" and I2.
I've tried to do it myself but it would only show the first value. Even when I use crtl+shift+enter.


Thank you, once again.
 
Upvote 0
Wow, this is what I am looking for.
Since it is for someone else to use it, it would be nice if it was possible to not use the auxiliary column "idx" and I2.
I've tried to do it myself but it would only show the first value. Even when I use crtl+shift+enter.


Thank you, once again.

Those are for efficiency...
 
Upvote 0
Thank you, that worked perfectly.

Do you mind telling me a place to get started with advanced excel commands, and even begVBA?
 
Upvote 0
Hi Aladin,

I had to add Columns with information about the names in the table, and it seems to break the function.
I've tried myself to correct it but didnt succeeded.

What can I do to get the same results from the new data table?
And what should I do if I have to add more columns with information about the searched name.

Example Data.

Row\Col
A​
InformationAInformationB
B​
C​
D​
E​
F​
1​
NameValue1Value2Value3Value4Value5
2​
JorgeBlaBlo
$10​
$5​
3​
AntonyBlaBla
$8​
$3​
$5​
$9​
$19​
4​
MariaBlab
$12​
$5​
5​
Potato
$5​

<tbody>
</tbody>

 
Upvote 0
I've tried to make it work more, and it seems that I was doing some mistakes.
Didnt even need to change your set up.

Thanks Aladin.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

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