Conditional formatting - highlight previous appearance

smide

Board Regular
Joined
Dec 20, 2015
Messages
162
Office Version
  1. 2016
Platform
  1. Windows
Hello.


In column A (A3:A600) I have a customer names and in column B (B3:B600) customer's cities (their current location).


In cell C3 there is a 'referent city'. When customer is in 'referent city' I need to highlight his previous appearence (column A).


example.



ABC
1
2CustomerCityRef. City
3J.CainRomeVienna
4L.ClarksonLondon
5B.DuncanBerlin
6Y.LarouciMelbourne
7B.DuncanVienna
8J.CainAmsterdam
9L.ClarksonVienna

<tbody>
</tbody>


explanation: Referent city (cell C3) is Vienna. Customer B.Duncan was in Vienna (cells A7 and B7), so his previous appearance was in cell A5 - highlight cell A5.
Same story for L.Clarkson (A9 and B9) so highlight his previous appearance in cell A4.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Not saying I'll answer this but further information may help others.
I'm going to assume some things based on your example data so you need to clarify things.

Based on your data I'm assuming:

1. A Customer will only ever appear a maximum of 2 times in column A?
If this is not the case should ALL the customers previous entries be highlighted. e.g. suppose L Clarkson was in A10 at city Paris should that be highlighted as well?

2. The reference city will only ever appear in teh cell C3? There will be no other reference cities in other cells?
If that's not correct that could prove a very complicated solution.
 
Last edited:
Upvote 0
Based on your data I'm assuming:

1. A Customer will only ever appear a maximum of 2 times in column A?
If this is not the case should ALL the customers previous entries be highlighted. e.g. suppose L Clarkson was in A10 at city Paris should that be highlighted as well?

Customer could appear more than 2 times in column A (A3:A600). Not all previous entries, just one (last) previous entry should be highlighted.

2. The reference city will only ever appear in teh cell C3? There will be no other reference cities in other cells?
If that's not correct that could prove a very complicated solution.

Just one referent city in cell C3, no other cities.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,422
Messages
6,119,396
Members
448,891
Latest member
tpierce

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