If cell is blank, go to next right one.

SinusxCosinusx

New Member
Joined
Nov 22, 2013
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I have a workbook with 4 sheets. In cell B16 of sheet "RBB" I want to create a formula to output the first value (from left to right) found between the columns L to AY of sheet "Belegerfassung" in the row related to the ID in column A. In sheet "RBB" this ID is reflected in cell E2.

Then the next cell B17 of sheet "RBB" shall output the next value (from left to right) found between the columns L to AY of sheet "Belegerfassung", as mentioned above. And so on, next cell B18... B19. The formula should ignore blank cells in the sheet "Belegerfassung", so it can show only from cells containing values. Also the next coming cells should not reproduce the same value the above cells already reproduced.

Same shall happen to the cells A16, A17, A18... in sheet "RBB". They should reproduce the respective column name from sheet "Belegerfassung" found in row 4.

I tested the below formula, but beside the fact that's too long, it's not effective:
Excel Formula:
=IF(VLOOKUP($E2,Belegerfassung!$A:$AY,12,FALSE)="",VLOOKUP($E2,Belegerfassung!$A:$AY,13,FALSE),IF(VLOOKUP($E2,Belegerfassung!$A:$AY,13,FALSE)="",VLOOKUP($E2,Belegerfassung!$A:$AY,14,FALSE),IF(VLOOKUP($E2,Belegerfassung!$A:$AY,14,FALSE)="",VLOOKUP($E2,Belegerfassung!$A:$AY,15,FALSE),IF(VLOOKUP($E2,Belegerfassung!$A:$AY,15,FALSE)="",VLOOKUP($E2,Belegerfassung!$A:$AY,16,FALSE),IF(VLOOKUP($E2,Belegerfassung!$A:$AY,16,FALSE)="",VLOOKUP($E2,Belegerfassung!$A:$AY,17,FALSE),IF(VLOOKUP($E2,Belegerfassung!$A:$AY,17,FALSE)="",VLOOKUP($E2,Belegerfassung!$A:$AY,18,FALSE),VLOOKUP($E2,Belegerfassung!$A:$AY,12,FALSE)))))))

Pic01.JPG

Pic02.JPG


P.S.: My regional settings are set up for Germany, that's why I use semicolon instead of comma.
 
also noticed by using this formula Excel overloads the PC for about a minute or two.
You are using whole column references so you are asking Excel to look at over 1 million rows (more than once) so there will be a significant drag on performance. In fact I got an "Excel ran out of resources .." message when I tried that formula structure.

This is how I would get the headers.

Cell Formulas
RangeFormula
A16:A42A16=IFERROR(INDEX(Tabelle3[[#Headers],[Notary]:[Certificate2]],AGGREGATE(15,6,(COLUMN(Tabelle3[[Notary]:[Certificate2]])-COLUMN(Tabelle3[Notary])+1)/(INDEX(Tabelle3[[Notary]:[Certificate2]],MATCH(E$2,Tabelle3[ID],0),0)<>""),ROWS(B$16:B16))),"")
B16:B42B16=IFERROR(INDEX(Tabelle3[[Notary]:[Certificate2]],MATCH(E$2,Tabelle3[ID],0),AGGREGATE(15,6,(COLUMN(Tabelle3[[Notary]:[Certificate2]])-COLUMN(Tabelle3[Notary])+1)/(INDEX(Tabelle3[[Notary]:[Certificate2]],MATCH(E$2,Tabelle3[ID],0),0)<>""),ROWS(B$16:B16))),"")
 
Upvote 0
Solution

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You are using whole column references so you are asking Excel to look at over 1 million rows (more than once) so there will be a significant drag on performance. In fact I got an "Excel ran out of resources .." message when I tried that formula structure.

This is how I would get the headers.

Cell Formulas
RangeFormula
A16:A42A16=IFERROR(INDEX(Tabelle3[[#Headers],[Notary]:[Certificate2]],AGGREGATE(15,6,(COLUMN(Tabelle3[[Notary]:[Certificate2]])-COLUMN(Tabelle3[Notary])+1)/(INDEX(Tabelle3[[Notary]:[Certificate2]],MATCH(E$2,Tabelle3[ID],0),0)<>""),ROWS(B$16:B16))),"")
B16:B42B16=IFERROR(INDEX(Tabelle3[[Notary]:[Certificate2]],MATCH(E$2,Tabelle3[ID],0),AGGREGATE(15,6,(COLUMN(Tabelle3[[Notary]:[Certificate2]])-COLUMN(Tabelle3[Notary])+1)/(INDEX(Tabelle3[[Notary]:[Certificate2]],MATCH(E$2,Tabelle3[ID],0),0)<>""),ROWS(B$16:B16))),"")
Hello Peter_SSs,

your solutions solved my case. Thank you very much for the formulas you combined. They work perfectly. ?
 
Upvote 0
Cheers. Glad they worked for you. Thanks for the confirmation. :)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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