Counting duplicates and assigning a tag

Msdtitus

New Member
Joined
Aug 31, 2010
Messages
38
Office Version
  1. 365
Platform
  1. Windows
I am looking for a formula which can assign a code based on predefined criteria
ABCDE
1StrategyNameAreaCallsPriority
2S1AmyBakery0
3S2JaneBakery1
4S3JaneBakery1
5S1AmyBakery0
6S1PeterBakery2
7S3PeterBakery2
8S2JaneBakery1
9S2AmyBakery0
10S1JaneBakery1

<tbody>
</tbody>

Part 1
The formula must look at how many calls was assessed for each person

What I need is a formula that looks at only the first 2 entries of a person(Amy) which should be given priority 1, and the balance to be given the priority 3 tag

Because Jane has 1 call already, only 1 call must be given the P2 code and the rest get a P3 code

in the event that a person has 2 or more calls, then they will automatically receive a P3 code

so ideally it should look like this when the code runs
ABCDE
1StrategyNameAreaCallsPriority
2S1AmyBakery0P1
3S3JaneBakery1P2
4S3JaneBakery1P3
5S3AmyBakery0P3
6S1PeterBakery5P3
7S3JakeBakery2P3
8S2JaneBakery1P3
9S2AmyBakery0P1
10S3JaneBakery1P3

<tbody>
</tbody>



Part 2
The above formula should also assign these codes based on the preferred strategy

As illustrated above, Amy has calls with the S1,S2 and S3 codes respectively and the Formula will look for the first look for a qualifying S1 it can find and assign them the P1 code, then S2 and if none exist, S3

For Jane, the best Strategy is S2 so that will receive the P2 code and the rest will receive P3 codes

I'm not sure if this is clear enough but this is a really complex piece of work.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Good Morning

is anyone able to assist me with the above request?
 
Upvote 0
Good Morning Guys

I would really like some assistance on this as I am trying all sorts of formulas but none seems to be working

I tried the following formula but this seems to be giving me half of what I need in that it flags the 1st instance of the duplicate but everything else gets the same Flag. See the formula below

=IF(COUNTIF($A$2:A2,A2)>2,"P3",IF(COUNTIF($A$2:A2,A2)=1,"P1","P2"))

Any assistance will be really valued

many thanks
Masood
 
Last edited:
Upvote 0
Good Morning all

i have still not been able to find a solution so if there is anyone on the Forum that may be able to assist i will geatly appreciate it
 
Upvote 0

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

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