+ Reply to Thread
Results 1 to 13 of 13

Help with IF OR AND

  1. #1
    Registered User
    Join Date
    05-17-2023
    Location
    Ohio
    MS-Off Ver
    365
    Posts
    28

    Help with IF OR AND

    Hi Everyone, I have a two-parter if you have a minute:


    a) Referring to the attached, I'm attempting to make J2 produce "TRUE" if any one of the conditions 1-4 below AND 5 are met, and "FALSE" if not:

    1. A2=C2 OR

    2. B2=E2 OR

    3. B2=I2 OR

    4. E2=I2

    5. AND F2 contains a number

    I tried IF(OR(AND( but came up short.


    b) Is it possible to remove "." and any text after it for any stock ticker in column C? For example, if I had "BRKB.X" and "META.Y", in C2 and C3, could I write a formula to produce only "BRKB" and "META", respectively? Something like concatenate?

    Thank you for your help.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: Help with IF OR AND

    Which Excel version? Is this 2011 a Mac version?

    Try this: =OR(A2=D2,B2=I2,A2=LEFT(C2,FIND(".",C2)-1))
    Last edited by AliGW; 07-29-2023 at 10:02 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: Help with IF OR AND

    Sorry - try this:

    =AND(ISNUMBER(F2),OR(A2=LEFT(C2,FIND(".",C2)-1),B2=E2,B2=I2,E2=I2))

  4. #4
    Registered User
    Join Date
    05-17-2023
    Location
    Ohio
    MS-Off Ver
    365
    Posts
    28

    Re: Help with IF OR AND

    Looks very close.

    I'm getting "FALSE" J2-J5 even though the text in B seems = to J. Please see new attached but with same name.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: Help with IF OR AND

    Hi tenma123,

    in j2 the formula =IF(AND(OR(A2=C2;B2=E2;B2=I2);ISNUMBER(F2)); "TRUE";"")

    note that I have removed a condition (B2=E2, B2=I2 -> is superfluous E2=I2)

    to delete characters from the dot (referring to the first line of the sample file provided)

    =IF(ISERROR(FIND(".";C2));C2;LEFT(C2;FIND(".";C2)-1))

    =IF(AND(OR(A2=IF(ISERROR(FIND(".";C2));C2;LEFT(C2;FIND(".";C2)-1));B2=E2;B2=I2);ISNUMBER(F2)); "TRUE";"")

    Bye
    Last edited by maxpit; 07-29-2023 at 10:19 AM.
    Max
    let's compare ideas

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: Help with IF OR AND

    Maxpit - the IF(...;"TRUE";"") bit is completely superfuluous.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: Help with IF OR AND

    F6 is NOT a number!

    =AND(ISNUMBER(F2),OR(A2=LEFT(C2,FIND(".",C2)-1),B2=E2,B2=I2,E2=I2))

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    H
    I
    J
    2
    ATLANTIC ALLIANCE PARTNERSHIP CORP
    TRUE
    3
    ITAMAR MEDICAL LTD
    TRUE
    4
    IDEX BIOMETRICS ASA
    TRUE
    5
    APHRIA INC
    TRUE
    6
    NEW FOUND GOLD CORP
    FALSE
    7
    ECMOHO LTD
    FALSE
    Sheet: Sheet2
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: Help with IF OR AND

    Hi aliGW,

    you are right, I know, but if tenma123 wants the string

    Bye
    Last edited by maxpit; 07-29-2023 at 10:27 AM.

  9. #9
    Registered User
    Join Date
    05-17-2023
    Location
    Ohio
    MS-Off Ver
    365
    Posts
    28

    Re: Help with IF OR AND

    It works!

    You both are amazing, thank you for your help.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: Help with IF OR AND

    You could try this:

    =AND(OR(ISNUMBER(F2),F2="n/a"),OR(A2=LEFT(C2,FIND(".",C2)-1),B2=E2,B2=I2,E2=I2))

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: Help with IF OR AND

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  12. #12
    Registered User
    Join Date
    05-17-2023
    Location
    Ohio
    MS-Off Ver
    365
    Posts
    28

    Re: Help with IF OR AND

    Done and done, thanks again AliGW

  13. #13
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: Help with IF OR AND

    glad to have participated

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1