+ Reply to Thread
Results 1 to 13 of 13

Combine VLOOKUP with TEXT Conversion?

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Combine VLOOKUP with TEXT Conversion?

    Hi,

    Im performing a VLOOKUP to return a decimal value:

    =VLOOKUP(A15,wk_2,17,FALSE)

    I then want to combine that with something like

    =TEXT(A15/(24*60),"[h]""hr ""m""m""")

    so that it converts the VLOOKUP number into hours and mins, whilst annotating accordingly. Im a bit stumped, could anyone help?

    Thanks
    Last edited by Barking_Mad; 11-03-2020 at 12:12 PM.

  2. #2
    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,410

    Re: Combine VLOOKUP with TEXT Conversion?

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Combine VLOOKUP with TEXT Conversion?

    The formula can't be in A15, as that is what you are using within your VLOOKUP formula, so your TEXT formula needs to act upon the cell that the VLOOKUP formula is in. If you want to combine them into one formula, it would be this:

    =TEXT(VLOOKUP(A15,wk_2,17,FALSE)/(24*60),"[h]""hr ""m""m""")

    Hope this helps.

    Pete

  4. #4
    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,984

    Re: Combine VLOOKUP with TEXT Conversion?

    Don't convert it to etext. Apply a cistom format, e.g.:

    hh" hr "mm" min"

    Edit: Hahaha. I'm sitting in near darkness. etext = text, cistom = custom
    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

  5. #5
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Combine VLOOKUP with TEXT Conversion?

    Quote Originally Posted by Pete_UK View Post
    If you want to combine them into one formula, it would be this:

    =TEXT(VLOOKUP(A15,wk_2,17,FALSE)/(24*60),"[h]""hr ""m""m""")
    Hi,

    Thanks, that's spot on. I nearly had it, I put my vlookup before my text.....Sorry I didnt include a sample workbook I didnt think it would be necessary
    Last edited by AliGW; 11-03-2020 at 12:17 PM. Reason: Please don't quote unnecessarily! You can quote part of a post, but you do not need to quote all of it.

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

    Re: Combine VLOOKUP with TEXT Conversion?

    It wasn't in the event, but it's always a good idea to add one, as sometimes it avoids unexpected bumps in the road.

  7. #7
    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,984

    Re: Combine VLOOKUP with TEXT Conversion?

    I just hope you don't want to add them up somewhere else on your sheet!!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Combine VLOOKUP with TEXT Conversion?

    Glenn,

    It would appear that the VLOOKUP formula is returning minutes as integers, so these would still need to be converted into Excel times (.../24/60) for the Custom format (or cistom format !!) to work.

    Pete

  9. #9
    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,984

    Re: Combine VLOOKUP with TEXT Conversion?

    Fair enough, Pete. But the cistom (!!) formatting is a better way forward, IMHO... I rarely disagree with you, sir, but on this occasion... I will. I spent ages trying to sum +ve and -ve time tonight, which made me realise the problems of time as text. Nightmare.

    Either way, it seems that Elvis has left the building...

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Combine VLOOKUP with TEXT Conversion?

    I agree with you - keep it as time format. I was just pointing out that the VLOOKUP formula needs to be manipulated before that cistom formatting would work.

    Pete

  11. #11
    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,410

    Re: Combine VLOOKUP with TEXT Conversion?

    For what it's worth, I would not use VLOOKUP when the lookup column and the results column are 17 columns apart - I'd use INDEX MATCH instead.

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

    Re: Combine VLOOKUP with TEXT Conversion?

    Quote Originally Posted by AliGW View Post
    For what it's worth, I would not use VLOOKUP when the lookup column and the results column are 17 columns apart - I'd use INDEX MATCH instead.
    Why? Apart from the problem of being able to count to 17 without error.....

  13. #13
    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,410

    Re: Combine VLOOKUP with TEXT Conversion?

    Well, that's one very good reason right there!!!

+ 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. VLOOKUP returns 0 after text conversion
    By NielsvB in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-17-2020, 10:24 AM
  2. Conversion from numbers with text to simply a number without text or zero.
    By RigbyDigby in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2019, 12:03 PM
  3. Replies: 4
    Last Post: 11-08-2017, 01:54 PM
  4. VLOOKUP conversion formula help
    By mgmacha71 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-17-2016, 11:11 PM
  5. How to combine vlookup and search text within cell
    By garriebartolome in forum Excel General
    Replies: 3
    Last Post: 04-14-2011, 09:43 AM
  6. Replies: 4
    Last Post: 04-14-2011, 06:56 AM
  7. Replies: 7
    Last Post: 12-11-2009, 05:03 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