Get Unique Values

kishorkhanal

Active Member
Joined
Mar 23, 2006
Messages
434
I want unique values from DailyJobs worksheet cells B4:B2199 to FixErrors worksheet cells B4:B2199. Please suggest a better option or correct the following two options.

Sub CopyUniques()
Worksheets("DailyJobs").Columns("B").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Worksheets("FixErrors").Range("B4"), Unique:=True
End Sub

AND


=IF(ROWS($B$4:B4)>SUM((DailyJobs!$B$4:$B$2199<>"")/(COUNTIF(DailyJobs!$B4:$B$2199,DailyJobs!$B4:$B$2199)+(DailyJobs!$B4:$B$2199=""))),"",INDEX(DailyJobs!$B4:$B$2199,MIN(IF(COUNTIF($B$3:B3,DailyJobs!$B4:$B$2199)=0,IF(DailyJobs!$B4:$B$2199<>"",ROW(DailyJobs!$B4:$B$2199)-ROW(DailyJobs!$B4)+1)))))

I would like to copy formula down from cell B4 to B2199. I don't need blank as unique value, if possible.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Upvote 0
You need the sheet name on ALL ranges, you missed it on the 1st one..

you missed some $

I've removed the sheet names just for ease of comparison to the formula in the other thread...Here's how it looks without the sheet names. just add DailyJobs! to the front of ALL Ranges..
Code:
=IF(ISERROR(MATCH(0,COUNTIF(B$4:B4,$B$4:$B$2199&""),0)),"",INDEX(IF(ISBLANK($B$4:$B$2199),"",$B$4:$B$2199),MATCH(0,COUNTIF(B$4:B4,$B$4:$B$2199&""),0)))

Also make sure you're entering it with CTRL + SHIFT + ENTER
After entering the formula, Highlight the cell and press F2, then
Press CTRL + SHIFT + ENTER
 
Upvote 0
Wait, scratch the EVERY range part...

=IF(ISERROR(MATCH(0,COUNTIF(B$4:B4,$B$4:$B$2199&""),0)),"",INDEX(IF(ISBLANK($B$4:$B$2199),"",$B$4:$B$2199),MATCH(0,COUNTIF(B$4:B4,$B$4:$B$2199&""),0)))

The bolded parts should refer to the sheet you're putting the new unique list on.

So on the sheet you want to PUT the NEW unique list
in B4 you put

=DailyJobs!B4

Then in B5 you put this

=IF(ISERROR(MATCH(0,COUNTIF(B$4:B4,DailyJobs!$B$4:$B$2199&""),0)),"",INDEX(IF(ISBLANK(DailyJobs!$B$4:$B$2199),"",DailyJobs!$B$4:$B$2199),MATCH(0,COUNTIF(B$4:B4,DailyJobs!$B$4:$B$2199&""),0)))
 
Upvote 0
Wait, scratch the EVERY range part...

=IF(ISERROR(MATCH(0,COUNTIF(B$4:B4,$B$4:$B$2199&""),0)),"",INDEX(IF(ISBLANK($B$4:$B$2199),"",$B$4:$B$2199),MATCH(0,COUNTIF(B$4:B4,$B$4:$B$2199&""),0)))

The bolded parts should refer to the sheet you're putting the new unique list on.

So on the sheet you want to PUT the NEW unique list
in B4 you put

=DailyJobs!B4

Then in B5 you put this

=IF(ISERROR(MATCH(0,COUNTIF(B$4:B4,DailyJobs!$B$4:$B$2199&""),0)),"",INDEX(IF(ISBLANK(DailyJobs!$B$4:$B$2199),"",DailyJobs!$B$4:$B$2199),MATCH(0,COUNTIF(B$4:B4,DailyJobs!$B$4:$B$2199&""),0)))

I did exactly as you said and copied down the formula but it does not work. It gives null value in every cell.
 
Upvote 0
Well it works for me...

Here's the sheet named DailyJobs, range B4:B20 (i only went to row 20)
#VALUE!
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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