Retrieving non-zero cell from a range

namy77

New Member
Joined
Apr 19, 2016
Messages
29
Good morning,

I am trying to retrieve the non zero cell from a range of cells to a new column (please see table below).

I tried Index and Match with little result. Any recommendation would be appreciated!

Thanks,

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD][/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]4[/TD]
[TD]0[/TD]
[TD]->[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]->[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]AA[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]->[/TD]
[TD]AA[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]0[/TD]
[TD]8[/TD]
[TD]->[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try,
I am assuming that there will only be on non zero value in the range.

Book1
ABCDE
1040->4
2500->5
3AA00->AA
4008->8
Sheet1
Cell Formulas
RangeFormula
E1{=INDEX(A1:C1,SMALL(IF(A1:C1<>0,COLUMN(A1:C1)-COLUMN(A1)+1),1))}
E2{=INDEX(A2:C2,SMALL(IF(A2:C2<>0,COLUMN(A2:C2)-COLUMN(A2)+1),1))}
E3{=INDEX(A3:C3,SMALL(IF(A3:C3<>0,COLUMN(A3:C3)-COLUMN(A3)+1),1))}
E4{=INDEX(A4:C4,SMALL(IF(A4:C4<>0,COLUMN(A4:C4)-COLUMN(A4)+1),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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