Hi,
Even though this is in the Excel Functions area, the following VBA procedure is one way and maybe easier than a complex set of function/fomulae
Name the cell at the top of your range ("Top"), i.e the Z cell in the example, and name a cell where you want the output to appear "Output"
Now run the following procedure:
Sub ShiftValuesLeft()
Dim iRows As Integer, iCols As Integer, x As Integer, y As Integer, icount As Integer
Dim MyArray(), rTop As Range
iRows = Range("Top").CurrentRegion.Rows.Count
iCols = Range("Top").CurrentRegion.Columns.Count - 1
Set rTop = Range("Top")
ReDim MyArray(iRows, iCols)
For x = 1 To iRows
For y = 1 To iCols
If rTop.Cells(x, y) <> "" Then
MyArray(x, icount) = rTop.Cells(x, y)
icount = icount + 1
End If
Next y
icount = 0
Next x
For x = 1 To iRows
For y = 1 To iCols
If MyArray(x, icount) <> "" Then
Range("Output").Cells(x, y) = MyArray(x, icount)
icount = icount + 1
End If
Next y
icount = 0
Next x
End Sub
HTH
Bookmarks