+ Reply to Thread
Results 1 to 12 of 12

LOOKUP() replace with formula in cell instead of value

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    vancouver
    MS-Off Ver
    Excel 2007
    Posts
    6

    LOOKUP() replace with formula in cell instead of value

    Hello!

    So I'm making an excel sheet to track what I eat. I managed to discover the LOOKUP() function and it is actually works! The problem is that the lookup function shows the value of the cell and not the formula contained in it.

    Heres the excel sheet
    Please Login or Register  to view this content.


    A9:E9 - A12:E12 contain the data. A15-E15 are using the LOOKUP function. I'm sure you all know how this works.

    The formula I'm using in cells B15-E15:
    =LOOKUP($A$15,$A$9:$A$12,$B$9:$B$12) respectively

    Now the cells with values actually have formulas in them and I would like to use the lookup command (i'm not sure of any other) and somehow use the formula inside the cell instead of the value.

    I hope this makes sense. As i'm sure you can see this is my first post

    Thanks!
    Last edited by sleepymatt; 05-08-2013 at 11:40 PM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: LOOKUP() replace with formula in cell instead of value

    Please attach a sample workbook with expected output for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    05-08-2013
    Location
    vancouver
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: LOOKUP() replace with formula in cell instead of value

    Ok here it is! Its in Sheet3 foodmacros.xlsx

    I just noticed something. Entering Chicken Breast, Fruit, or whey in A15 returns the correct lookup values but when I put rice in A15 it returns the values in the fruit row.

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

    Re: LOOKUP() replace with formula in cell instead of value

    Try using vlookup instead...

    =VLOOKUP($A15,$A$9:$E$12,COLUMN(B1),FALSE)
    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

  5. #5
    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: LOOKUP() replace with formula in cell instead of value

    deleted duplicate post

  6. #6
    Registered User
    Join Date
    05-08-2013
    Location
    vancouver
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: LOOKUP() replace with formula in cell instead of value

    Nice!! That fixed the issue of rice not showing correctly. Thanks!

  7. #7
    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: LOOKUP() replace with formula in cell instead of value

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  8. #8
    Registered User
    Join Date
    05-08-2013
    Location
    vancouver
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: LOOKUP() replace with formula in cell instead of value

    Not fixed just yet .. that was just one problem. The only issue is that VLOOKUP works great for matching a cell with a specific row, But the row has formulas in it and I'm looking to have those in the VLOOKUP cells instead of the VLOOKUP command (and the values of the relative cells).

    The whole purpose of this is to make a kind of database with all the foods I eat and their carb/fat/protein content. When I'm calculating for the day, I would just enter say rice and the rest of the row would populate automatically (with the formulas in the relative cells .. not the VLOOKUP command). Then, I can adjust the amount based on what I ate and the carb/fat/protein cells would adjust as well.

    I updated the excel sheet to try and show what I would like the outcome to look like.

    foodmacros-updated.xlsx
    Last edited by sleepymatt; 05-09-2013 at 12:48 AM.

  9. #9
    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: LOOKUP() replace with formula in cell instead of value

    OK you lost me what are you entering/changing manually and what is supposed to calc from that?

    can you walk me through, step-by-step what you are doing, and what you want the results to be (and where)

  10. #10
    Registered User
    Join Date
    05-08-2013
    Location
    vancouver
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: LOOKUP() replace with formula in cell instead of value

    I made you a video! I'm having a hard time explaining this using text lol. Sorry about the audio quality

    http://www.youtube.com/watch?v=430s71kiZ9c

  11. #11
    Registered User
    Join Date
    05-08-2013
    Location
    vancouver
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: LOOKUP() replace with formula in cell instead of value

    So is this even possible to do? Or should I look for another way?

  12. #12
    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: LOOKUP() replace with formula in cell instead of value

    I cant access youtube from work, sorry (firewalls and stuff)

+ 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