Based on the ID and Header find the first non blank cell with the data and match it in the next table

SylwekS

New Member
Joined
Aug 27, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am facing the problem when creating the report, I was trying to use index match, lookup, vlookup, if's, connect them somehow together but never get the solution, so i hope someone will be able to help with this.

Based on the ID and Header I need to find the first non blank cell and the data which is there, this is small example i have around 60 + headers and around 100000 rows.

I will appreciate any help.

ABCDEFGHIJKL
1​
What i haveWant to have
2​
3​
IDaaabbbccccdddIDaaabbbcccddd
4​
1​
text1
1​
text1text2
5​
1​
text2
2​
text3text4text5
6​
2​
text3
3​
text6text7text8
7​
2​
text4
8​
2​
text5
9​
3​
text6
10​
3​
text7
11​
3​
text8
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi SylwekS,

Does this work for you?

SylwekS.xlsx
ABCDEFGHIJKL
1What i haveWant to have
2
3IDaaabbbccccdddIDaaabbbcccddd
41text11 text1text2 
51text22text3text4 text5
62text33 text6text7text8
72text40    
82text5     
93text6     
103text7     
113text8     
12     
Sheet1
Cell Formulas
RangeFormula
H4:H12H4=IFERROR(INDEX($A$4:$A$100000,AGGREGATE(15,6,ROW($A$4:$A$100000)-ROW($A$3)/(ISNA(MATCH($A$4:$A$100000,$H$3:H3,0))),1)),"")
I4:L12I4=IFERROR(INDEX(B$4:B$100000,AGGREGATE(15,6,ROW($A$4:$A$100000)-ROW($A$3)/((B$4:B$100000<>"")*($A$4:$A$100000=$H4)),1)),"")
 
Upvote 0
Hi SylwekS,

Does this work for you?

SylwekS.xlsx
ABCDEFGHIJKL
1What i haveWant to have
2
3IDaaabbbccccdddIDaaabbbcccddd
41text11 text1text2 
51text22text3text4 text5
62text33 text6text7text8
72text40    
82text5     
93text6     
103text7     
113text8     
12     
Sheet1
Cell Formulas
RangeFormula
H4:H12H4=IFERROR(INDEX($A$4:$A$100000,AGGREGATE(15,6,ROW($A$4:$A$100000)-ROW($A$3)/(ISNA(MATCH($A$4:$A$100000,$H$3:H3,0))),1)),"")
I4:L12I4=IFERROR(INDEX(B$4:B$100000,AGGREGATE(15,6,ROW($A$4:$A$100000)-ROW($A$3)/((B$4:B$100000<>"")*($A$4:$A$100000=$H4)),1)),"")

Hello,

Thank you, I am testing it now on the production but it seems it is working perfectly, a bit heavy but this is solving my problem, saving like 80% of time and reducing risk of error (y)

BR,
SylwekS
 
Upvote 0
You're welcome!
Much of the performance challenge will be that I have Excel 2016 so I don't have the UNIQUE function to populate column H.
If you've UNIQUE available it would run much faster.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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