#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 138
Default If And Formula

Hi, Hope you can help me, I am half way to a formula but can't quite get the
last stage.

I have a sequence, example BHX-CDG/TLS-CDG/BHX

I am using the following formula
==IF(AND(LEFT(H53076,3)=RIGHT(H53076,3),LEN(H53076 )=19),"YES","NO")

But I need to take it a stage further to also say if the CDG and CDG = the
same, so if position 5-7 matches positions 13- 15 as an additional condition,
so in the example above if CDG and CDG were the same that would be the extra
condition, but I can't work out how to get there.

Any ideas?

Many thanks

Paula

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default If And Formula

If positions are fixed then you can do something like;
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

This does not check for lenght... You can add it to AND codition where one
of the test will be the one above...

Let me know how it goes.

"Paula" wrote:

Hi, Hope you can help me, I am half way to a formula but can't quite get the
last stage.

I have a sequence, example BHX-CDG/TLS-CDG/BHX

I am using the following formula
==IF(AND(LEFT(H53076,3)=RIGHT(H53076,3),LEN(H53076 )=19),"YES","NO")

But I need to take it a stage further to also say if the CDG and CDG = the
same, so if position 5-7 matches positions 13- 15 as an additional condition,
so in the example above if CDG and CDG were the same that would be the extra
condition, but I can't work out how to get there.

Any ideas?

Many thanks

Paula

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 138
Default If And Formula

Hi, that worked!! Thanks for the formula, made my life a lot easier
tonight... Cheers Paula


"Sheeloo" wrote:

If positions are fixed then you can do something like;
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

This does not check for lenght... You can add it to AND codition where one
of the test will be the one above...

Let me know how it goes.

"Paula" wrote:

Hi, Hope you can help me, I am half way to a formula but can't quite get the
last stage.

I have a sequence, example BHX-CDG/TLS-CDG/BHX

I am using the following formula
==IF(AND(LEFT(H53076,3)=RIGHT(H53076,3),LEN(H53076 )=19),"YES","NO")

But I need to take it a stage further to also say if the CDG and CDG = the
same, so if position 5-7 matches positions 13- 15 as an additional condition,
so in the example above if CDG and CDG were the same that would be the extra
condition, but I can't work out how to get there.

Any ideas?

Many thanks

Paula

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



All times are GMT +1. The time now is 06:25 PM.

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

About Us

"It's about Microsoft Excel"