# Formula that sort a list .

#### IFTODE

##### New Member
 A B A B 1 LIST 1 List without "0" cels - NEEDED 1 forumula form the List 1 2 0 Johny 2 =if(data=true,"Mario","0") 3 Johny Ella 3 =if(data=true,"Johny","0") 4 Ella Johny 4 =if(data=true,"Ella","0") 5 0 Maria 5 ... 6 0 Annabel 6 ... 7 0 George 7 ... 8 0 8 ... 9 Johny 9 ... 10 0 10 ... 11 0 11 ... 12 Maria 12 ... 13 Annabel 13 ... 14 George 14 =if(data=true,"George","0") ... ...

<tbody>
</tbody>

Hello,

I need a formula to rearrange information in list number two eliminating cells that contain "0", as can be seen in the example in "B" column.
Ps: As I complete in the excel data sheet some values ​​in column "A" change from "0" to the text such as "Mario".

Thank you

Last edited:

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

#### shanesuzanne

##### New Member
I'm a bit confused on what you are trying to accomplish. Row 2 mentions Mario in the formula - but has Johny in column B. Then, there are zero values in column A - and column B is blank, or sometimes it has a name.

Also, you mention "rearrange" - as in sorting? Or are you simply wanting the zeros to not display when the criteria for the IF statement isn't met?

#### IFTODE

##### New Member
Hi,
in list from column "B" i need to do somthing like this: the formula =if(A2=0;if(A3=0;If(A4=0;if(....;If(A5000=0;"";A5000);....);A4);A3);A2) so the result will be a name after a name...not a name after a "0" or a blank space. and the List A will remain unchanged.
is a shorter way? but not array formula, because are like 10000 cells..and work longer after every edit
Thank you

Last edited:

#### CyrusTheVirus

##### Well-known Member
Are you only wanting a formula B to extract all names from column A?

I know you said you didn't want an array formula, but here is one you could use. At 10,000 rows it shouldn't take that long.

B2 (enter with Ctrl+Shift+Enter, not just enter):
Code:
=IFERROR(INDEX(\$A\$2:\$A\$10000,SMALL(IF(\$A\$2:\$A\$10000<>0,ROW(\$A\$2:\$A\$10000)-ROW(\$A\$2)+1),ROWS(\$B\$2:B2))),"")

Last edited:

#### IFTODE

##### New Member
Hi,
Yes.
this formula works.
Thank you

You're welcome.

Replies
1
Views
103
Replies
1
Views
192
Replies
1
Views
149
Replies
1
Views
137
Replies
6
Views
152

1,133,524
Messages
5,659,315
Members
418,496
Latest member
WHYCHumphrey

### 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.

### Which adblocker are you using?

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

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