Create a list from existing list ignoring zero values

awanak

New Member
Joined
Oct 6, 2018
Messages
37
Office Version
  1. 2019
Platform
  1. Windows
i want to creat a list from existing list ignoring zero values

For Example [TABLE="width: 500"]
<tbody>[TR]
[TD]Original List[/TD]
[TD]List to be created[/TD]
[/TR]
[TR]
[TD]Aslam[/TD]
[TD]Aslam[/TD]
[/TR]
[TR]
[TD]Akram[/TD]
[TD]Akram[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Mohsin[/TD]
[/TR]
[TR]
[TD]Mohsin[/TD]
[TD]Waseem[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Waseem[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi,

Ctrl+Shift+Enter NOT just Enter

B2 =IFERROR(INDEX($A$2:$A$9,MATCH(0,IF($A$2:$A$9<>0,COUNTIF($B$1:B1,$A$2:$A$9)),0)),"")

[TABLE="width: 232"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Original List[/TD]
[TD]Unique List[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Aslam[/TD]
[TD]Aslam[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Akram[/TD]
[TD]Akram[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]0[/TD]
[TD]Mohsin[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Mohsin[/TD]
[TD]Waseem[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Waseem[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($A$2:$A$9,SMALL(IF(1-($A$2:$A$9=0),ROW($A$2:$A$9)-ROW($A$2)+1),ROWS($1:1))),"")
 
Upvote 0
Create a list on another from existing list on sheet 1 ignoring zero values

Hi,
I want to creat a list on another sheet from an existing list on sheet 1 or some other sheet ignoring zero values
Sheet-1 (Original List)
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sheet-1 (Original List)[/TD]
[TD]Sheet-2 (List to be created)[/TD]
[/TR]
[TR]
[TD]Waseem[/TD]
[TD]Waseem[/TD]
[/TR]
[TR]
[TD]Mohsin[/TD]
[TD]Mohsin[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Waqas[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Vicky[/TD]
[/TR]
[TR]
[TD]Waqas[/TD]
[TD]Zohra[/TD]
[/TR]
[TR]
[TD]Vicky[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Zohra[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Re: Create a list on another from existing list on sheet 1 ignoring zero values

Copy paste to the second sheet and filter out the null values
 
Upvote 0
Re: Create a list on another from existing list on sheet 1 ignoring zero values

the original list is ever changing dear. need some other way out
 
Upvote 0
Re: Create a list on another from existing list on sheet 1 ignoring zero values

Welcome to the MrExcel board!

A formula approach:
Adjust the Sheet1 ranges in this formula to at least cover that data and then copy the formula down.

Excel Workbook
A
1Waseem
2Mohsin
3Waqas
4Vicky
5Zohra
6
7
Sheet2
 
Upvote 0
Re: Create a list on another from existing list on sheet 1 ignoring zero values

Doesn't this part adapt the range's length ? ( still some tweaking needed of course)
Code:
[TABLE="class: highlight tab-size js-file-line-container"]
<tbody>[TR]
[TD="class: blob-code blob-code-inner js-file-line"]        lngLastRow = .Range("F" & .Rows.Count).End(xlUp).Row
[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
[TABLE="class: highlight tab-size js-file-line-container"]
<tbody>[TR]
[TD="class: blob-code blob-code-inner js-file-line"]        Set rngData = .Range("F5:F" & lngLastRow)[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
   
[TABLE="class: highlight tab-size js-file-line-container"]
<tbody>[TR]
[TD="class: blob-code blob-code-inner js-file-line"][/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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