+ Reply to Thread
Results 1 to 13 of 13

IF Function for Text and Multible Results in One Cell.

  1. #1
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    IF Function for Text and Multible Results in One Cell.

    Hi

    I would like to know if it is possible for an "IF Function" to return different results in one cell only seperated by a comma?

    I have a number of tests in column A.
    In the top of column B, C & D I have three different test categories.
    The trick is then, that I'm going to mark an "X" next to a test number, underneath the category it belongs to.
    Then I want another cell to show the test name, depending on where the "X" has been placed. AND if there are multiple "Xs" I want that cell to show all the names seperated by a comma or semicolon.

    Is this possible without to much programming?

    Thanks for your time.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Function for Text and Multible Results in One Cell.

    Hi

    Maybe ..=IF(B2="x",$A2,"")

    Copy down and right of your cell..
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF Function for Text and Multible Results in One Cell.

    Hi,

    Upload your workbook showing both before and after situations. We need to see your request in context to be able to help.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    Re: IF Function for Text and Multible Results in One Cell.

    Yeah, I tried to upload but it didn't work, so I took a risk and went ahead without. Anyways, here it is.
    Attached Files Attached Files

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Function for Text and Multible Results in One Cell.

    Hi

    I am quite sure that must be an easier way. But a solution could be(using two helper columns) this.

    In G3, put this.

    Please Login or Register  to view this content.
    In H3, this.

    Please Login or Register  to view this content.
    Then in F3, this.

    Please Login or Register  to view this content.
    Probably, you will need to replace semi-colons of my formula, to comma.

    Hope, that help you.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    Re: IF Function for Text and Multible Results in One Cell.

    Don't both. I actually figured it out. Thanks anways,

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Function for Text and Multible Results in One Cell.

    Both Posts, in the same minute!!

  8. #8
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    Re: IF Function for Text and Multible Results in One Cell.

    Ha ha. Great.
    But thanks man. Precieate it!

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Function for Text and Multible Results in One Cell.

    You are welcome

    Is your solution easier, that mine? I am curious!

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: IF Function for Text and Multible Results in One Cell.

    This is the solution I came up with. Put this formula in F3 and copy it down...

    =IF(B3="x",B$1&IF(COUNTIF(C3:D3,"x"),", ",""),"")&IF(C3="x",C$1&IF(D3="x",", ",""),"")&IF(D3="x",D$1,"")

  11. #11
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: IF Function for Text and Multible Results in One Cell.

    Quote Originally Posted by Rick Rothstein View Post
    This is the solution I came up with. Put this formula in F3 and copy it down...

    =IF(B3="x",B$1&IF(COUNTIF(C3:D3,"x"),", ",""),"")&IF(C3="x",C$1&IF(D3="x",", ",""),"")&IF(D3="x",D$1,"")
    Just wondering if you (the OP) had seen this single formula solution or not?

  12. #12
    Registered User
    Join Date
    04-10-2012
    Location
    Aalborg
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    20

    Re: IF Function for Text and Multible Results in One Cell.

    Quote Originally Posted by Fotis1991 View Post
    You are welcome

    Is your solution easier, that mine? I am curious!
    I thought mine was easier, but I think yours is more solide.
    Rick Rothstein's is basically what i figured out myself: Using only the IF-Function and adding several results in one cell with "&".

  13. #13
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF Function for Text and Multible Results in One Cell.

    ..That's good!

  14. #14
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: IF Function for Text and Multible Results in One Cell.

    Quote Originally Posted by Bjourne View Post
    Rick Rothstein's is basically what i figured out myself: Using only the IF-Function and adding several results in one cell with "&".
    Just pointing out in case you missed what the formula I posted does exactly... it not only concatnates the text together, but it makes sure there is only ever one comma between items and the the text never ends with a comma.

  15. #15
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: IF Function for Text and Multible Results in One Cell.

    Quote Originally Posted by Bjourne View Post
    Rick Rothstein's is basically what i figured out myself: Using only the IF-Function and adding several results in one cell with "&".
    Just pointing out in case you missed what the formula I posted does exactly... it not only concatnates the text together, but it makes sure there is only ever one comma between items and the the text never ends with a comma.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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