countif....only once

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
Hello

My range of data is E12:E75 in worksheet "Data" contains city names (they repeat a few times)

In my "Calculation" worksheet, I would like to show the names only appear once from the list in E12:E75.

Is there any formulas? can someone pls advise.

thx you!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi JW01,

Let assume:
1. data is in range E12:E75 in worksheet "Data" & E12 value is “Cities”
2. range A1 value is “Cities” in worksheet "Calculation" (same as in E12 in worksheet "Data")

This code will give you what you want
Code:
Sub Macro1()
    Range("Data!E12:E75").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("Calculation!A1"), Unique:=True
End Sub
 
Upvote 0
Hello

My range of data is E12:E75 in worksheet "Data" contains city names (they repeat a few times)

In my "Calculation" worksheet, I would like to show the names only appear once from the list in E12:E75.

Is there any formulas? can someone pls advise.

thx you!

Calculation

A1: #List#

A2, control+shift+enter, not just enter, and copy down:
Code:
=IFERROR(INDEX(Data!$E$2:$E$75,MODE(IF(Data!$E$2:$E$75<>"",
   IF(ISNA(MATCH(Data!$E$2:$E$75,$A$1:A1,0)),
    MATCH(Data!$E$2:$E$75,Data!$E$2:$E$75,0)*{1,1})))),"")
 
Upvote 0
Hello Aladin,

I pasted the formula you provided in U52, and changed the $A$1:A1 to $U$52:U5 and dragged it down, but i get blanks?...any suggestions? thx u for your help.

array:

=IFERROR(INDEX(Data!$E$12:$E$75,MODE(IF(Data!$E$12:$E$75<>"",IF(ISNA(MATCH(Data!$E$12:$E$75,$U$52:U52,0)),MATCH(Data!$E$12:$E$75,Data!$E$12:$E$75,0)*{1,1})))),"")

also, i appreciate the macro, but i need a formula, thxs tho!
 
Last edited:
Upvote 0
Hello Aladin,

I pasted the formula you provided in U52, and changed the $A$1:A1 to $U$52:U5 and dragged it down, but i get blanks?...any suggestions? thx u for your help.

array:

=IFERROR(INDEX(Data!$E$12:$E$75,MODE(IF(Data!$E$12:$E$75<>"",IF(ISNA(MATCH(Data!$E$12:$E$75,$U$52:U52,0)),MATCH(Data!$E$12:$E$75,Data!$E$12:$E$75,0)*{1,1})))),"")

also, i appreciate the macro, but i need a formula, thxs tho!

The formula must go in U53 and it must be confirmed with control+shift+enter, not just enter.
 
Upvote 0

Forum statistics

Threads
1,224,530
Messages
6,179,373
Members
452,907
Latest member
Roland Deschain

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