Remove Blank Cells in table

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
567
Office Version
  1. 365
Platform
  1. Windows
I inquired before about something similar to this but this is a different spreadsheet.

I have a large table (about 60 rows) but I will base my example on just 1 row then I will replicate the formula throughout.

The large table on worksheet B has reference code in cell A1 (ABC) then different results are in B1, C1 & D1.

On worksheet A I do a 3 Vlookup's for the ref. code (ABC) in cell D1, E1, & F1 bringing over the results on wrksht B B1,C1 & D1. BUT 1 or more of those cells could be blank so for example B1 contains 123, C1 is blank and D1 contains 789 which would translate over to D1 (123) E1 (blank) & F1 (789) on Wrksheet A.

I am looking for a formula (index?) that would remove the blank E1 cell on worksheet A and fill it with the data from D1 of wrksht b so the end result would be D1 (123), E1 (789) & F1 (blank). Basically remove the blank cells from the table and move all the data to the left not showing any blanks on worksheet A.

Hope I explained this good enough.

Thank you,
James
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi, would be wonderful for all, if you try prepare a data example using add-in specifically for this and it can be found here XL2BB
If would necesary, pay attention to this post XL2BB 2 Square
 
Upvote 0
If you're only having three columns being returned, why not keep it simple and do something like =IF(ISBLANK(VLOOKUP(Sheet2!A1:D1,3,0)),VLOOKUP(Sheet2!A1:D1,4,0),VLOOKUP(Sheet2!A1:D1,3,0))
 
Upvote 0
So in D1 you would do two nested IFs and in E1 you would do one.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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