+ Reply to Thread
Results 1 to 5 of 5

having trouble with an IF OR formula

  1. #1
    Registered User
    Join Date
    05-22-2015
    Location
    California
    MS-Off Ver
    2007
    Posts
    1

    having trouble with an IF OR formula

    Ok, here goes.

    I have a large spreadsheet that I must enter data into regularly, and I'm trying to make it a little less complicated.
    Below is a written out version of what I want to do. Hopefully this is clear:

    If text (any text or value) is entered in N2 AND O2 then M2 is Purple
    If N2 and O2 are blank (no value or text) then M2 is Red
    If N2 is blank BUT O2 has text (any text or value), then M2 is Blue.

    I've been watching youtube videos but nothing seems to help....

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: having trouble with an IF OR formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: having trouble with an IF OR formula

    IF(AND(LEN(N2)<>0,LEN(O2)<>0),"Purple",IF(LEN(N2)+LEN(O2)=0,"Red",IF(AND(N2="",LEN(O2)<>0,"Blue","OTHER")))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: having trouble with an IF OR formula

    Use conditional formatting
    Add these three conditions

    For purple
    Please Login or Register  to view this content.
    For red
    Please Login or Register  to view this content.
    For blue
    Please Login or Register  to view this content.
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: having trouble with an IF OR formula

    IF(AND(LEN(N2)<>0,LEN(O2)<>0),"Purple",IF(LEN(N2)+LEN(O2)=0,"Red",IF(AND(N2="",LEN(O2)<>0,"Blue","OTHER")))

    or even

    IF(LEN(N2)=0,IF(LEN(O2)=0,"Red","Blue"),IF(LEN(O2)<>0,"Purple","OTHER"))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] if(and formula trouble
    By Groovicles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-26-2013, 08:55 AM
  2. [SOLVED] IF formula trouble!
    By caffeica in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2012, 08:00 PM
  3. I'm new at this - having trouble with a formula
    By Dave in forum Excel General
    Replies: 3
    Last Post: 01-07-2006, 10:20 PM
  4. [SOLVED] Trouble with formula
    By Keith in forum Excel General
    Replies: 10
    Last Post: 05-22-2005, 06:52 PM
  5. Trouble with formula
    By Kristajea in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-19-2005, 06:06 PM

Tags for this Thread

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