+ Reply to Thread
Results 1 to 4 of 4

How to use results of VLOOKUP in calculation

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to use results of VLOOKUP in calculation

    I've been lurking for a while and I've found so much help here. You folks are really something. I'm up against something I can't figure out. I’ve been searching for help with what I want to do and have come up dry. Below is an outline of whqt I want to do. Any help will be appreciated.

    · Worksheet1 has data.
    · Worksheet2 uses VLOOKUP back to worksheet1 for data to populate cells on worksheet2. The VLOOKUP
    command below returns a value of 126 to cell C6.
    · I want to use the number result of the VLOOKUP in C6 (126) as part of a calculation for another cell. In this
    case, cell D6 is keyed in. I want to get the result of =(N(D6)-N(C6)) and put it in cell F6. To further
    complicate things, if C6 is blank, I want F6 to be blank.


    VLOOKUP formula that returns a value of 126 from worksheet1 and puts it in cell C6 on worksheet2. It also returns a blank if there is a blank on worksheet1.

    =IF(ISNA(VLOOKUP(A6,Pivot_Table!$A$3:$D$36,3,0))+(VLOOKUP(A6,Pivot_Table!$A$3:$D$36,3,0)=""),"",VLOOKUP(A6,Pivot_Table!$A$3:$D$36,3,FALSE))

  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
    52,946

    Re: How to use results of VLOOKUP in calculation

    Hi and welcome to the forum

    Not really sure what you are trying to do there, all 3 vlookups are the same (False and 0 are the same)?

    =IF(ISNA(
    VLOOKUP(A6,Pivot_Table!$A$3:$D$36,3,0))+(
    VLOOKUP(A6,Pivot_Table!$A$3:$D$36,3,0)=""),"",
    VLOOKUP(A6,Pivot_Table!$A$3:$D$36,3,FALSE))

    And if the result is already a number, you dont need the N() part either.

    So you need something like =IF(C6="","",C6+D6)
    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
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: How to use results of VLOOKUP in calculation

    Welcome to the forum TigerCat,

    If I'm reading correctly, in F6 enter =IF(C6="","",D6-C6)

    I don't know why you are using the N() function! Do you sometimes get a non-numeric value, and need to force 0?

    I hope this helps, please let me know!

    Regards,

    David

    Please remember, your request is clearer if you attach a sample workbook.
    - Click on Go Advanced and click on the Paper Clip.
    When you reply please make it clear WHO you are responding to by mentioning their name.
    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.
    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

  4. #4
    Registered User
    Join Date
    04-09-2014
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to use results of VLOOKUP in calculation

    Well, I certainly made this more complicated than necessary. Your formula suggestions really helped. The idea behind the multiple VLOOKUPs was to give me back a 0 if there was a 0 there and a blank instead of #N/A if there was no record for that employee or contractor in worksheet1. I've learned tons about formulas, macros, and VLOOKUP with this workbook but it's obvious I have much more to learn. I really appreciate your help and this forum is wonderful.

+ 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] Using VLookup but results show formula instead of results...
    By excel me in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-28-2013, 09:40 PM
  2. Calculation problem to produce 3 different results from IF
    By mgxeab in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2013, 04:11 AM
  3. VLookup that Results with False or Blank Results
    By mycon73 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-12-2013, 07:16 PM
  4. Inconsistent Calculation Results
    By thomasutley in forum Excel General
    Replies: 5
    Last Post: 04-26-2012, 12:14 AM
  5. Calculation on SUMIF Results
    By Andy B in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2005, 12:05 AM

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