Replace duplicate values with zero or blank

aris

New Member
Joined
Nov 28, 2004
Messages
27
Dear friends

I have two columns A and B. Column A has names ans column B numbers.
Example: Suppose that the name PETER appears in colmn A ten times. The corresponding numbers in Column B are 2 5 9 5 5 12 5 4 8 4. Now I would like to make column C and D. Column C must have the name PETER 10 times as in A and coumn D must have the same numbers but where we have duplicate valus to be replaced by blank or zero. the results i would like to have is
C D
Peter 2
Peter 5
peter 9
peter 0 or blank
peter 0 or blank
peter 12
peter 0 or blank
peter 4
peter 8
peter 0 or blank

Can you please help on how to create columns C and D?
Is there any function to do this?

Thank you very much!

Aris
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,

Here are 2 options:

If you want to compare only the number:

D2: =IF(COUNTIF($B$1:B1,B2),"",B2)


If you want to compare both name and number:

F2: =IF(SUMPRODUCT(--($A$1:A1=A2),--($B$1:B1=B2)),"",B2)
Book1
ABCDEF
1
2Peter222
3Peter555
4peter999
5peter5  
6peter5  
7peter121212
8peter5  
9peter444
10peter888
11peter4  
Sheet4
 
Upvote 0

Forum statistics

Threads
1,203,758
Messages
6,057,184
Members
444,913
Latest member
ILGSE

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