How to Create a Unique Number

kimberly090

Board Regular
Joined
May 22, 2014
Messages
99
Hi,

I wish to create condition formatting for my customer:

This will be my data:

seel_zpsadd005d1.jpg


I wish to create a condition formatting for the specific customer called Jack.

For example,

1. If Ticket number for Jack will be 123, than the ticket number cannot be repeated on others customer. If others customer are using the same ticket number, than the customer named will be highlighted.

2. For others customer, Kurt and Kimberly or others new entry customer, they ticket number can be use repeatedly.

3. The ticket number shall not repeat again once the specific customer Jack have appear on the top. For example in B10, the the ticket number should be key in with other number that is not same as the top Jack's ticket number and others customer ticket number. It should be a unique number like 789. If it repeat, the cell will be highlighted.

Thank you.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Use this for validation of cell B2 , then copy validation to other cells.

Validation--> Custom

Code:
=IF(COUNTIF($A$2:$A2,$A2)=1,COUNTIF($B$2:$B2,$B2)=1,COUNTIF($A$2:$A2,$A2)=COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2))
 
Upvote 0
For example,

1. If Ticket number for Jack will be 123, than the ticket number cannot be repeated on others customer. If others customer are using the same ticket number, than the customer named will be highlighted.

2. For others customer, Kurt and Kimberly or others new entry customer, they ticket number can be use repeatedly.

3. The ticket number shall not repeat again once the specific customer Jack have appear on the top. For example in B10, the the ticket number should be key in with other number that is not same as the top Jack's ticket number and others customer ticket number. It should be a unique number like 789. If it repeat, the cell will be highlighted.
My understanding is that if B10 in your screen shot was 789 then row 10 would not be highlighted but row 6 would be because Kimberly has used Jack's numnber (123).

If B10 was 789 and B6 was also 789 would row 6 be highlighted because Kimberly has used a number of Jack's or would a Kimberly|789 row only be highlighted if it is after a Jack|789 row?
 
Upvote 0
My understanding is that if B10 in your screen shot was 789 then row 10 would not be highlighted but row 6 would be because Kimberly has used Jack's numnber (123).

If B10 was 789 and B6 was also 789 would row 6 be highlighted because Kimberly has used a number of Jack's or would a Kimberly|789 row only be highlighted if it is after a Jack|789 row?

Hi, Kimberly will be only highlighted after a Jack|789 row.
Jack will be highlighted when on the top of the list contain of Jack|789.
 
Upvote 0
Use this for validation of cell B2 , then copy validation to other cells.

Validation--> Custom

Code:
=IF(COUNTIF($A$2:$A2,$A2)=1,COUNTIF($B$2:$B2,$B2)=1,COUNTIF($A$2:$A2,$A2)=COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2))

Hi, I have try the rule, but for the customer besides than Jack, they can share the same ticket number.
Than for Jack at below will be highlighted if it share the same ticket number with Jack that appear on the top.
For example on Jack (B2) have ticket number on 123, than on Jack,B10 ( which Jack appear after different customer) it cannot share the same ticket number with Jack(B2) which is 123, it must use a unique ticket number like 987.
 
Upvote 0
This also will do,
Code:
=COUNTIF($A$2:$A2,$A2)=COUNTIF($B$2:$B2,$B2)
Hi, I have tried this also, Jack should not share the same ticket number with others customer. If they contain same customer number, it will be highlighted or prompt message.
Then, Jack ticket number should not be the same with the number with Jack on B2:B4 after few customer.
 
Upvote 0
Try selecting from A2:B??(end of data) and apply the Conditional Formatting rules shown.

Excel Workbook
AB
1NameTicket
2Jack123
3Jack123
4Jack123
5Kimberly456
6Kimberly123
7Kimberly456
8Kurt456
9Kurt587
10Jack123
11Jack789
CF Jack
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A21. / Formula is =AND($A2<>"Jack",COUNTIFS($A$1:$A1,"Jack",$B$1:$B1,$B2))Abc
A22. / Formula is =AND($A2="Jack",$A1&$B1<>$A2&$B2,COUNTIFS($A$1:$A1,"Jack",$B$1:$B1,$B2))Abc
 
Upvote 0
Try selecting from A2:B??(end of data) and apply the Conditional Formatting rules shown.

CF Jack

AB
1NameTicket
2Jack123
3Jack123
4Jack123
5Kimberly456
6Kimberly123
7Kimberly456
8Kurt456
9Kurt587
10Jack123
11Jack789

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:70px;"><col style="width:56px;"></colgroup><tbody>
</tbody>

Conditional formatting
CellNr.: / ConditionFormat
A21. / Formula is =AND($A2<>"Jack",COUNTIFS($A$1:$A1,"Jack",$B$1:$B1,$B2))Abc
A22. / Formula is =AND($A2="Jack",$A1&$B1<>$A2&$B2,COUNTIFS($A$1:$A1,"Jack",$B$1:$B1,$B2))Abc

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Hi, I have try~ yes, it is almost match what I want.
But after I try the result, I found out that if on Kimberly(B5) is 456, than on Jack(B10) if I type in 456, it will not be highlighted.
The result should be Jack cannot contain any ticket number which is same like others customer. So which meant, on Jack(B10) should be highlighted due to it contain same ticket number with Kimberly*B5)

4_zps132960c4.jpg
 
Upvote 0

Forum statistics

Threads
1,216,163
Messages
6,129,223
Members
449,495
Latest member
janzablox

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