If And Formula

  • Thread starter Thread starter Paula
  • Start date Start date
P

Paula

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
 
If positions are fixed then you can do something like;
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,13,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.
 
Hi, that worked!! Thanks for the formula, made my life a lot easier
tonight... Cheers Paula
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top