Results 1 to 5 of 5

Thread: Incorporating truncation within VLOOKUP function

  1. #1
    Seeker EchoDelta's Avatar
    Join Date
    Feb 2015
    Posts
    8
    Articles
    0
    Excel Version
    2013

    Incorporating truncation within VLOOKUP function



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Is it possible to incorporate truncation (TRUNC or INT) within VLOOKUP function? I have a formula and it works just fine except the result is not always a whole number. I have another formula which looks at this result but requires a whole number.

    Formula is:

    = VLOOKUP(J2,'[Handicap.xlsm]'!$A$6:$F$209,6,)

    Thanks,
    Ed

  2. #2
    Just use

    =INT(VLOOKUP(J2,'[Handicap.xlsm]'!$A$6:$F$209,6,))

  3. #3
    Seeker EchoDelta's Avatar
    Join Date
    Feb 2015
    Posts
    8
    Articles
    0
    Excel Version
    2013
    I just realized that I made a mistake. Your response was exactly what I asked for. What I really need is to have the number rounded to the nearest whole number because some of the numbers need to be rounded up. I have tried to replace INT with ROUND but get an error message “Your formula contains an error.” I believe it is looking for the number of decimal places after the whole number, which I want to be zero. I have tried putting “0” in multiple places within the formula, each resulting in the same error message. Hopefully this can be achieved.

    Thanks for any advice.

    Ed

  4. #4
    This should work

    =ROUND(VLOOKUP(J2,'[Handicap.xlsm]'!$A$6:$F$209,6,),0)

  5. #5
    Seeker EchoDelta's Avatar
    Join Date
    Feb 2015
    Posts
    8
    Articles
    0
    Excel Version
    2013
    Thank you kind sir.

    When cell J2 was blank, I was getting the dreaded “#N/A” error so I added a test for J2 being blank and ended up with the following:

    =IF($J2="","",(ROUND(VLOOKUP($J2,'[Handicap.xlsm]'!$A$6:$F$209,6,),0)))

    Thanks again.

    Ed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •