Value from row

Tariq123

New Member
Joined
Nov 5, 2022
Messages
13
Office Version
  1. 2013
If a row contain different value. Like. A1=0, B1=3, C1=0 D1=4. Then i need first value which is greater then 0. In another cell.
0 3 0 4
I need first value greater then 0, means 3 in A5 cell.
And 2nd value greater then zero in A6 which is 4.
How its possible through formula
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
try this
Excel Formula:
=TRANSPOSE(SMALL(IF(A1:D1>0,A1:D1),ROW(INDIRECT("1:"&COUNTIF(A1:D1,">0")))))
 
Upvote 0
I need as below
0 3 5 0 4
First value 3
Second value 5
Third value 4
Formula should ignore the 0 value.
 
Upvote 0
your first example had 4 values, your recent reply has 5 values. below is the same formula showing each of your examples.
-------------------
Values from row no 0.xlsx
ABCDEFGH
1030434
203504345
Sheet1
Cell Formulas
RangeFormula
F1:G1,F2:H2F1=TRANSPOSE(SMALL(IF(A1:E1>0,A1:E1),ROW(INDIRECT("1:"&COUNTIF(A1:E1,">0")))))
Dynamic array formulas.

------------------
if this is still not working for you, please share what you are getting so can figure out why.
 
Upvote 0
Hi
Thank you for your reply.
Sir your formula result is 0.
I tried below formula but this for is only for Ist vale but i required second and third also.
=index(A1:E1,MATCH(TRUE,INDEX(A1:E1)<>0,),0))
 
Upvote 0
Try this in G1:
Excel Formula:
=MID(SUBSTITUTE(TEXTJOIN("",TRUE,$A$1:$E$1),"0",""),COLUMNS($A$1:A1),1)

And copy to the right for as many cells as needed.
 
Upvote 0
@ExceLoki , @Leo Skywalker
The OP's profile shows Excel 2013 so they will not have 'spill' ability or TEXTJOIN function.

If a row contain different value. Like. A1=0, B1=3, C1=0 D1=4. Then i need first value which is greater then 0. In another cell.
0 3 0 4
I need first value greater then 0, means 3 in A5 cell.
And 2nd value greater then zero in A6 which is 4.
How its possible through formula
Try this

22 11 17.xlsm
ABCDE
10304
2
3
4
53
64
7 
8 
9 
>0
Cell Formulas
RangeFormula
A5:A9A5=IFERROR(INDEX(A$1:E$1,AGGREGATE(15,6,COLUMN(A$1:E$1)/(A$1:E$1>0),ROWS(A$5:A5))),"")
 
Upvote 0
Peter,

You're right... no spilling, no TEXTJOIN
Here are other two options, replacing TEXTJOIN with manual concat

If you want to copy to the right, results in the same row:
Excel Formula:
=MID(SUBSTITUTE($A$1&$B$1&$C$1&$D$1&$E$1,"0",""),COLUMNS($A$1:A1),1)

If you want to copy down, results in the same column:
Excel Formula:
=MID(SUBSTITUTE($A$1&$B$1&$C$1&$D$1&$E$1,"0",""),ROWS($A$1:A1),1)
 
Upvote 0
Hi
Greeting

I tried below formula. Its working if the value in single digit. If the is 15 then it will write 1 in one cell and 5 in next cell.

=MID(SUBSTITUTE($A$1&$B$1&$C$1&$D$1&$E$1,"0",""),ROWS($A$1:A1),1)
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,228
Members
453,025
Latest member
Hannah_Pham93

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