+ Reply to Thread
Results 1 to 10 of 10

Need help with creating an if/then/or formula

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Need help with creating an if/then/or formula

    I have three empty cells where a user can enter any of the following values. A1 = Blue, A2 = Red, A3 = Green. If someone enters nothing, I need cell B1 to remain blank, if someone enters only one value (either Blue, Red, or Green), then I need B1 to return the word "color", if someone enters more than one value (Blue and Green for example), then I need B1 to return the word "colors".

    Thanks for any help!

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Need help with creating an if/then/or formula

    How aout this:

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need help with creating an if/then/or formula

    Try this

    =IF(COUNTA(A1:A3)=0,"","Colors")

    Or

    =IF(OR(A1:A3={"Blue","Red","Green"}),"Colors","")
    Last edited by AlKey; 04-21-2015 at 12:36 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Re: Need help with creating an if/then/or formula

    Ok, so to complicate things a bit...

    Let's say I have cells A1:A50... if all of those cells are blank, then cell B1 is blank, if ONLY ONE of those cells is not blank, then B1 returns the word "color", if two or more cells are not blank, then B1 returns the word "colors".

    Any ideas?

  5. #5
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Need help with creating an if/then/or formula

    If you're going to move the goalposts, then a slight modification of Alkey's formula should work:

    Please Login or Register  to view this content.
    Cheers,
    Last edited by ConneXionLost; 04-21-2015 at 12:45 PM.

  6. #6
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Re: Need help with creating an if/then/or formula

    Thank you guys! One last thing, let's say I have formulas in cells A1:A50, and those formulas are either going to return a value of blank (""), or some text. How could I create a formula that would check cells A1:A50, and if all values were returned blank, then cell B1 is blank, if A1:A50 return only one field with text, then B1 returns the word "color", and if there are more than one cells from A1:A50 that contain text, then B1 returns the word "colors".

    I'm not sure if something like this is possible because maybe Excel considers a cell with a formula in it to be text?

    Thanks for any help here! I feel like I'm getting close-

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need help with creating an if/then/or formula

    Quote Originally Posted by AlKey View Post

    =IF(OR(A1:A3={"Blue","Red","Green"}),"Colors","")
    That needs to be array entered.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Re: Need help with creating an if/then/or formula

    So the array formula would only give a result of blank or "colors". How do I get it to return (1) blank if all cells are blank, (2) the word "color" if there is only text in one cell, and (3) "colors" if there is text in more than one cell?

    And I don't want to limit the kind of text that can be in cells A1:A50 to just different colors. In other words, if there is ANY text in cells A1:A50, that counts.
    Last edited by danielneedssomehelp; 04-21-2015 at 03:12 PM.

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need help with creating an if/then/or formula

    Dear danielneedssomehelp,

    Out of what was offered before you actually never mentioned of whether or not you had any problems with the formulas. And I am wondering if you ever tried them at all. I do hope, that maybe next time, you will be better prepared regarding your requirements and for yourself have a better understanding of what your really want.

    Best regards,

    Alex

  10. #10
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Re: Need help with creating an if/then/or formula

    Yes AlKey, sorry for the confusion, and point well taken. Your formula works, my spreadsheet just started getting more complicated. Thank you for your help!

+ 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] Use an existing cell formula for creating a new more complex formula
    By dubcap01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 07:41 AM
  2. Replies: 1
    Last Post: 11-21-2012, 02:03 AM
  3. Creating a formula
    By Californication in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-27-2007, 07:16 PM
  4. Creating a formula via VBA
    By pik6235571 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2007, 11:31 AM
  5. [SOLVED] I need help creating a formula
    By Kim in forum Excel General
    Replies: 11
    Last Post: 11-19-2005, 04:10 PM

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