Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Using the AND and OR functions in the same formula

I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A" OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to string
it all together. Help, please. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,939
Default Using the AND and OR functions in the same formula

You can use And / Or in the same function but you need to be very careful
with your bracket and such. Try this...

=IF(AND(LEFT(A1,1)="7", OR(LEFT(C1,1)="A",
LEFT(C1,1)="T", LEFT(C1,1)="G")), A1 & B1 & C1, "")

--
HTH...

Jim Thomlinson


"Jan Buckley" wrote:

I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A" OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to string
it all together. Help, please. Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Using the AND and OR functions in the same formula

Try this:

IF(OR(AND(LEFT(A1,1)="7",LEFT(C1,1)="A"),LEFT(C1,1 )="T",LEFT(C1,1)="G"),A1&B1&C1,"")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Jan Buckley" wrote:

I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A" OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to string
it all together. Help, please. Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default Using the AND and OR functions in the same formula

One way that seems to work.

=IF(AND(LEFT(A1,1)="7",OR(LEFT(C1,1)="A",LEFT(C1,1 )="T",LEFT(C1,1)="G")),CONCATENATE(A1,B1,C1))

"Jim Thomlinson" wrote in message
...
You can use And / Or in the same function but you need to be very careful
with your bracket and such. Try this...

=IF(AND(LEFT(A1,1)="7", OR(LEFT(C1,1)="A",
LEFT(C1,1)="T", LEFT(C1,1)="G")), A1 & B1 & C1, "")

--
HTH...

Jim Thomlinson


"Jan Buckley" wrote:

I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A"
OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to
string
it all together. Help, please. Thank you.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Using the AND and OR functions in the same formula

=IF(OR(LEFT(C1,1)="T",LEFT(C1,1)="G",AND(LEFT(A1,1 )="7",LEFT(C1,1)="A")),CONCATENATE(A1,B1,C1),"")

All on one line.......watch out for the posting word-wrap

Vaya con Dios,
Chuck, CABGx3



"Jan Buckley" wrote:

I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A" OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to string
it all together. Help, please. Thank you.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 618
Default Using the AND and OR functions in the same formula

"Jan Buckley" wrote in message
...
I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A"
OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to string
it all together. Help, please. Thank you.


Assuming that you intend AND to take precedence over OR, and that you want
your answer cell to be blank if the condittion isn't met, then try:
=IF(OR(AND(LEFT(A1,1)="7",LEFT(C1,1)="A"),LEFT(C1, 1)="T",LEFT(C1,1)="G"),CONCATENATE(A1,B1,C1),"")

Otherwise, shuffle the formula accordingly.
--
David Biddulph


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Using the AND and OR functions in the same formula

WELL....afer *carefully* re-reading the request...and realizing that my first
post missed the mark.

Here's an option that you could try
=IF(AND(LEFT(A1,1)="7",ISNUMBER(SEARCH(LEFT(C1,1), "ATG"))),A1&B1&C1,"")

Note: Instead of using the CONCATENATE function, you can just link the text
values to be joined by ampersands (&)

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Try this:

IF(OR(AND(LEFT(A1,1)="7",LEFT(C1,1)="A"),LEFT(C1,1 )="T",LEFT(C1,1)="G"),A1&B1&C1,"")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Jan Buckley" wrote:

I need to create a formula that says IF LEFT(A1,1)="7" AND LEFT(C1,1)="A" OR
LEFT(C1,1)="T" OR LEFT(C1,1)="G", THEN CONCATENATE(A1,B1,C1)

I don't know if I can use AND and OR in the same formula, or how to string
it all together. Help, please. Thank you.

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 12:49 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"