Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Validate format of values

Client is using WinXP/Office 2003.
He has cells with Canadian postal codes. The postal codes should be 6
characters starting with a letter and then alternating every other with a
number. For example, V2L3M4. He would like a formula to evaluate the cell to
determine if the postal code follows the correct syntax. Any ideas?
--
maryj
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Validate format of values

Hello Maryj.

If your zip code is in A1 you could use this formula:
=AND(ISNUMBER(LEFT(A1))=FALSE;ISNUMBER(MID($A1;2;1 )*1);ISNUMBER(MID($A1;3;1)*1)=FALSE;ISNUMBER(MID($ A1;4;1)*1);ISNUMBER(MID($A1;5;1)*1)=FALSE;ISNUMBER (MID($A1;6;1)*1);LEN(A1=6)
)

It checks each digit to determine whether it is text or number.

Per Erik

On Mon, 19 Mar 2007 12:38:20 -0700, maryj
wrote:

Client is using WinXP/Office 2003.
He has cells with Canadian postal codes. The postal codes should be 6
characters starting with a letter and then alternating every other with a
number. For example, V2L3M4. He would like a formula to evaluate the cell to
determine if the postal code follows the correct syntax. Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Validate format of values

Thanks! Perfect!
--
maryj


"Per Erik Midtrød" wrote:

Hello Maryj.

If your zip code is in A1 you could use this formula:
=AND(ISNUMBER(LEFT(A1))=FALSE;ISNUMBER(MID($A1;2;1 )*1);ISNUMBER(MID($A1;3;1)*1)=FALSE;ISNUMBER(MID($ A1;4;1)*1);ISNUMBER(MID($A1;5;1)*1)=FALSE;ISNUMBER (MID($A1;6;1)*1);LEN(A1=6)
)

It checks each digit to determine whether it is text or number.

Per Erik

On Mon, 19 Mar 2007 12:38:20 -0700, maryj
wrote:

Client is using WinXP/Office 2003.
He has cells with Canadian postal codes. The postal codes should be 6
characters starting with a letter and then alternating every other with a
number. For example, V2L3M4. He would like a formula to evaluate the cell to
determine if the postal code follows the correct syntax. Any ideas?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking up a name and then being able to validate it twynsys Excel Worksheet Functions 0 November 29th 06 02:48 PM
Looking up a name and then being able to validate it twynsys via OfficeKB.com Excel Worksheet Functions 0 November 21st 06 04:43 PM
Search and Validate Mike Smith NC Excel Discussion (Misc queries) 2 July 10th 06 04:14 AM
How to validate edwardpestian Excel Worksheet Functions 4 June 9th 06 01:13 AM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"