ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF,AND,OR (https://www.excelbanter.com/excel-discussion-misc-queries/202639-if.html)

Paula

IF,AND,OR
 
Hi, I have 2 formulas which I use and I wish to combine them in one formula...
In the same cell I have 2 things I am trying to pick out..

The following
LON/AMS/LON
I do this with formula which was kindly given by this forum...
=IF(AND(left(f2,3)=right(f2,3),len(f2)=11),"yes"," no")

I also look for
LON/AMS/NYC/AMS/LON
I use 2 formulas for this
=LEN(cell reference) to find all cells with 19 characters.
a second formula is
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

I really need to combine all 3 formulas above into one so that it will say
yes to either of the above strings of data, or no, if it meets neither
criteria.. can you help?

Many thanks
Paula





Mike H

IF,AND,OR
 
Maybe

=IF(AND(LEFT(A1,3)=RIGHT(A1,3),LEN(A1)=11),"yes",I F(AND(LEFT(A1,3)&MID(A1,5,3)=(RIGHT(A1,3)&MID(A1,1 3,3)),LEN(A1)=19),"YES","NO"))

Mike

"Paula" wrote:

Hi, I have 2 formulas which I use and I wish to combine them in one formula...
In the same cell I have 2 things I am trying to pick out..

The following
LON/AMS/LON
I do this with formula which was kindly given by this forum...
=IF(AND(left(f2,3)=right(f2,3),len(f2)=11),"yes"," no")

I also look for
LON/AMS/NYC/AMS/LON
I use 2 formulas for this
=LEN(cell reference) to find all cells with 19 characters.
a second formula is
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

I really need to combine all 3 formulas above into one so that it will say
yes to either of the above strings of data, or no, if it meets neither
criteria.. can you help?

Many thanks
Paula





Paula

IF,AND,OR
 
Hi Mike,

Thanks so much for the advice, I changed the And to Or and it worked when I
did this, many thanks
Paula


"Mike H" wrote:

Maybe

=IF(AND(LEFT(A1,3)=RIGHT(A1,3),LEN(A1)=11),"yes",I F(AND(LEFT(A1,3)&MID(A1,5,3)=(RIGHT(A1,3)&MID(A1,1 3,3)),LEN(A1)=19),"YES","NO"))

Mike

"Paula" wrote:

Hi, I have 2 formulas which I use and I wish to combine them in one formula...
In the same cell I have 2 things I am trying to pick out..

The following
LON/AMS/LON
I do this with formula which was kindly given by this forum...
=IF(AND(left(f2,3)=right(f2,3),len(f2)=11),"yes"," no")

I also look for
LON/AMS/NYC/AMS/LON
I use 2 formulas for this
=LEN(cell reference) to find all cells with 19 characters.
a second formula is
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

I really need to combine all 3 formulas above into one so that it will say
yes to either of the above strings of data, or no, if it meets neither
criteria.. can you help?

Many thanks
Paula






All times are GMT +1. The time now is 12:49 PM.

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