Validating Australian Post Code Range - Conditional Formatting Formula

louisepr

New Member
Joined
Nov 5, 2020
Messages
27
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi :)
I am looking to validate Australian Postal Codes (column I) based on the state value in column H with conditional formatting if possible
The postcode of each state must start with the number as listed below. So, If State = SA and Postcode does not start with 5, highlight the cell. Or If State = QLD and Postcode does not start with 4, highlight the cell etc.
SA 5,
QLD 4
NSW 2
VIC 3
WA 6
TAS 7
ACT 2
NT 0

1612400001224.png


Thanks in advance :)
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi,

One way.
Create a State and Postal Code table as in my sample (Must be in Alpha Order),
Then use the formula for Conditional Formatting:

Book3.xlsx
HIJKLM
1StatePostcodeACT2
2NSW2
3SA3095TRUENT0
4SA5114FALSEQLD4
5SA5034FALSESA5
6VIC5114TRUETAS7
7VIC3095FALSEVIC3
8VIC3029FALSEWA6
Sheet731
Cell Formulas
RangeFormula
J3:J8J3=LEFT(I3)+0<>LOOKUP(H3,L$1:L$8,M$1:M$8)


If you don't want to have a State/Postal Code table in your sheet, we can Hardcode the Table within the formula, let me know.
 
Upvote 0
Solution
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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