Find each occurance in row & return value

skyhigh_ct

New Member
Joined
Jul 14, 2007
Messages
29
Hello. I am looking for a function that looks across a row & finds each instance of a value & returns that value. The 1st instance would be returned in a column (same row), the 2nd instance would be returned in the next column. e.g. row:
A1 b1 c1 d1 e1
0 3 0 7 0

I would like the resulting formula to return:
F1 to = 3
G1 to = 7

I would then copy this formula down. The thing is I do not know what each unique occurance will be for each row.

Thank you.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hello. I am looking for a function that looks across a row & finds each instance of a value & returns that value. The 1st instance would be returned in a column (same row), the 2nd instance would be returned in the next column. e.g. row:
A1 b1 c1 d1 e1
0 3 0 7 0

I would like the resulting formula to return:
F1 to = 3
G1 to = 7

I would then copy this formula down. The thing is I do not know what each unique occurance will be for each row.

Thank you.
Not real clear.

It looks like you want to extract the non-zero cell entries?

If that's not what you want then we'll need a more detailed explanation will several samples along with the expected results.
 
Upvote 0
I should have been more clear, my appologies.
Yes, I am looking to extract non-zero cell entries.
Thanh you.
 
Upvote 0
I should have been more clear, my appologies.
Yes, I am looking to extract non-zero cell entries.
Thanh you.
Try this...

Book1
ABCDEFGHIJK
103070_37___
211005_115__
300000______
412345_12345
Sheet1

This array formula** entered in G1:

=IF(COLUMNS($G1:G1)>COUNTIF($A1:$E1,"<>0"),"",INDEX($A1:$E1,SMALL(IF($A1:$E1<>0,COLUMN($A1:$E1)),COLUMNS($G1:G1))-COLUMN($A1)+1))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Copy across to K1 then down as needed.
 
Upvote 0
yes, very nice, thank you T. Valko.

What is I wanted to clean up my data & replaced all 0s with blank cells?
What would the new array formula be to extract non-blank cell entries?

Same example & results as before, except cells with 0 would be blank.

Thank you
 
Upvote 0
yes, very nice, thank you T. Valko.

What is I wanted to clean up my data & replaced all 0s with blank cells?
What would the new array formula be to extract non-blank cell entries?

Same example & results as before, except cells with 0 would be blank.

Thank you
Change the formula to:

=IF(COLUMNS($G1:G1)>COUNTIF($A1:$E1,"<>"),"",INDEX($A1:$E1,SMALL(IF($A1:$E1<>"",COLUMN($A1:$E1)),COLUMNS($G1:G1))-COLUMN($A1)+1))

Still array entered.
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,896
Members
452,948
Latest member
Dupuhini

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