ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If And Formula (https://www.excelbanter.com/excel-discussion-misc-queries/202036-if-formula.html)

Paula

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


Sheeloo

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


Paula

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



All times are GMT +1. The time now is 10:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com