remove blank cells from horizontal list

palaeontology

Active Member
Joined
May 12, 2017
Messages
444
Office Version
  1. 2016
Platform
  1. Windows
I have the following values in the range BF54:DD54 ...

1599522954514.png


I'm currently using the following formula to return the same list of values into the range F54:BD54 ...

={IF(COLUMN(BF:BF)<=SUM(--($BF53:$DD53<>""))+1,INDEX($BF53:$DD53,0,SMALL(IF($BF53:$DD53<>"",COLUMN($BF53:$DD53)-1,""),COLUMN(F:F)-1)),"")}

however, it's returning a blank in every cell in that range.

Can anyone see where I've gone wrong with my formula ?

Please don't tell me I can use data validation or other methods to do the same ... I definitely want to use a formula for this, for reasons of my own.

Kind regards,

Chris
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
I meant to say that I;m trying to write the formula needed to rewrite this list ...

1599561983587.png


as this list, where the blank column cells have been removed ....

1599561914954.png


I have about 400 rows that each have their own unique list that need to be re-written with blank cells removed.

Can anyone see why my formula (original post) isn't working ?

Kind regards,

Chris
 
Upvote 0
I figured it out ...

I needed the following ...

=IF(COLUMN(BF:BF)-56<=SUM(--($BF54:$DD54<>""))+1,INDEX($BF54:$DD54,0,SMALL(IF($BF54:$DD54<>"",COLUMN($BF54:$DD54)-57,""),COLUMN(BF:BF)-57)),"")
 
Upvote 0
Another option
=IFERROR(INDEX($BF54:$DD54,AGGREGATE(15,6,(COLUMN($BF54:$DD54)-COLUMN($BF54)+1)/($BF54:$DD54<>""),COLUMNS($F54:F54))),"")

The advantage of this option is that if any new columns are subsequently inserted at the left of the worksheet, this will still return the same results - yours will not.
 
Upvote 0

Forum statistics

Threads
1,214,397
Messages
6,119,273
Members
448,883
Latest member
fyfe54

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