# 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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

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

#### CyrusTheVirus

##### Well-known Member
You're welcome.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,521
Messages
5,854,198
Members
431,626
Latest member
Willway22

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