+ Reply to Thread
Results 1 to 12 of 12

1 or blank cell pulls exact text or leaves cell blank

Hybrid View

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    66

    Question 1 or blank cell pulls exact text or leaves cell blank

    I am asking a person's race and they have the option to select many. The output is given as such:

    Pt Race_1 Caucasian Pt Race_2_African American Pt Race_3_Asian or Pacific Islander Pt Race_4_Other_Text
    1 1 Person's text response

    So, if it is answered there is a 1 but if not the cell is blank. Can I code for a blank cell in the lookup function below? (I know it's not correct, I don't know how to do it).
    =LOOKUP('Qualtrics Output'!AJ3,{1,blank},{"Caucasian","blank"})

    Each cell is going to have to have its own function but they should all be similar (minus the Other Text option).


    For the Other Text cell I need to be able to pull the exact text answered but also have the ability to have a blank cell if there is nothing in said cell (it currently gives me a zero). ='Qualtrics Output'!AK3
    Last edited by sharpmel; 11-30-2012 at 12:29 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: 1 or blank cell pulls exact text or leaves cell blank

    try this...
    =LOOKUP('Qualtrics Output'!AJ3,{1,""},{"Caucasian",""})

    edit: if you have a bunch of selections, it may be better to put them in a separate table, and use a vlookup() to return what you need
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-27-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: 1 or blank cell pulls exact text or leaves cell blank

    It comes up as #N/A rather than a blank cell.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: 1 or blank cell pulls exact text or leaves cell blank

    Please Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.

  5. #5
    Registered User
    Join Date
    11-27-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: 1 or blank cell pulls exact text or leaves cell blank


  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: 1 or blank cell pulls exact text or leaves cell blank

    Why not..

    =IF('Qualtrics Output'!AJ3="","",LOOKUP('Qualtrics Output'!AJ3,{1},{"Caucasian"}))
    you can then add lookups for 2,3,4, etc too within the curly brackets
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  7. #7
    Registered User
    Join Date
    11-27-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: 1 or blank cell pulls exact text or leaves cell blank

    There's no other numbers. It is a 1 or a blank cell. If it is a blank cell then I want it to remain blank. I still want the formula to account for it though.

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: 1 or blank cell pulls exact text or leaves cell blank

    In that case simply..

    =IF('Qualtrics Output'!AJ3="","","Caucasian")

  9. #9
    Registered User
    Join Date
    11-27-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: 1 or blank cell pulls exact text or leaves cell blank

    I have =LOOKUP('Qualtrics Output'!DY3,{1,""},{"headstart",""}) but the blank cell will bring up #N/A. I need that cell to be completely blank.

  10. #10
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: 1 or blank cell pulls exact text or leaves cell blank

    Try it like this:

    =LOOKUP('Qualtrics Output'!AO3,{0,1},{"","Caucasian"})

  11. #11
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: 1 or blank cell pulls exact text or leaves cell blank

    Try this elegant version:

    =REPT("Caucasian",'Qualtrics Output'!AO3)

  12. #12
    Registered User
    Join Date
    11-27-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: 1 or blank cell pulls exact text or leaves cell blank

    They both come back with a blank cell which is what I want. Could you explain the difference between the two?

+ 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