+ Reply to Thread
Results 1 to 17 of 17

How to modify Vlookup to return value without commas

  1. #1
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    How to modify Vlookup to return value without commas

    I have this issue: I am using Vlookup to retrieve data from multiple cells with multiple Vlookup ex.:

    Please Login or Register  to view this content.
    and so on.

    So the return value is something like: John, Mery, Sam, Raf, Tray, Sarah.

    However at times the value in a cell does not exist (is empty) and the return Vlookup is something like this: John, , ,Sam, , ,.

    I would like to see something like: John, Sam

    How do i tell excel not to show the commas if the cell is empty? (or to skip that cells if empty)

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: How to modify Vlookup to return value without commas

    Welcome to the Forum logi_non_tech !

    A straightforward way is to string a bunch of tests together:

    IF(Vlookup (A1, A3:K20, 2, 0)="","",Vlookup (A1, A3:K20, 2, 0)&",") & ........

    What is the empty cell you're referring to? The value in A1, or the lookup value in A:K? Depending on what your data looks like this might work:

    IF(A1="","",Vlookup (A1, A3:K20, 2, 0)&",") & ........
    Last edited by 6StringJazzer; 10-05-2018 at 12:36 PM.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    Hi 6StringJazzer,
    thank you for your reply.

    I am quite new to excel formula, I am not sure I understand what you mean.

    Can you elaborate a little bit more?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: How to modify Vlookup to return value without commas

    Use this formula:

    =IF(VLOOKUP(A1,A3:K20,2,0)="","",VLOOKUP(A1,A3:K20,2,0)&",")&IF(VLOOKUP(A1,A3:K20,3,0)="","",VLOOKUP(A1,A3:K20,3,0)&",")&IF(VLOOKUP(A1,A3:K20,4,0)="","",VLOOKUP(A1,A3:K20,4,0)&",")&IF(VLOOKUP(A1,A3:K20,5,0)="","",VLOOKUP(A1,A3:K20,5,0)&",")&VLOOKUP(A1,A3:K20,6,0)

    If that does not do what you need then please attach a file with sample data, but do not include private data. The paper clip icon does not work for attachments. Instead, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

  5. #5
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    I tried, it did not work, i continue to have the results like John, , Mery, , , , Sam, Oliver, , , Sarah, Tom,...

  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,460

    Re: How to modify Vlookup to return value without commas

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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.

  7. #7
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    Sure, here it is:

  8. #8
    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,460

    Re: How to modify Vlookup to return value without commas

    Nope ... Nothing yet!

  9. #9
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    The uploader is not working, and it does not let me post a link either

  10. #10
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    [cut] post removed
    Last edited by logi_non_tech; 10-06-2018 at 11:59 AM.

  11. #11
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    See if this works
    Attached Images Attached Images

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to modify Vlookup to return value without commas

    Never mind.... Try this out:

    Please Login or Register  to view this content.
    see sheet

    I didn't use your exact ranges as this makes the point suffiiciently clearly.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  13. #13
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    THANK YOU!!!!!!!! it worked!!!!!

  14. #14
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    Just for me to understand what do parameters after if() mean? is it something like once the IF does not find any value, move to th enext cell?

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to modify Vlookup to return value without commas

    If the result of the formula is anything other than 0, then add a comma and a space, otherwise add nothing. THEN move on to the next cell.

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  16. #16
    Registered User
    Join Date
    10-05-2018
    Location
    Boston
    MS-Off Ver
    2016
    Posts
    14

    Re: How to modify Vlookup to return value without commas

    Thanks, just a simple question to learn a little more: why then I need to add the first part to it?
    Please Login or Register  to view this content.
    and not simply
    Please Login or Register  to view this content.
    ?

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to modify Vlookup to return value without commas

    because the result of that will either be a comma/space.... or nothing at all.

+ 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] Return multiple matchng VLOOKUP values in one cell separated by commas?
    By zendoo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-14-2015, 06:10 AM
  2. [SOLVED] Return text between last two commas
    By huwtre in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2014, 07:10 AM
  3. How to modify placement of automatic commas in worksheet
    By tanvir.bukhari in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-28-2012, 09:45 AM
  4. [SOLVED] Replacing commas with carriage return
    By Hardip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. Replacing commas with carriage return
    By Hardip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  6. Replacing commas with carriage return
    By Hardip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. Replacing commas with carriage return
    By Hardip in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2005, 09:05 AM

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