1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved excel cell number variable

Discussion in 'Business Applications' started by nomad, Mar 2, 2016.

Thread Status:
Not open for further replies.
  1. nomad

    nomad Thread Starter

    Joined:
    Sep 30, 1999
    Messages:
    386
    I have the following formula:

    =IF(Estimate!D2=0,"",VLOOKUP(Estimate!D2,Pricing!$C$4:$G$200,2,FALSE))

    Where is says "Estimate!D2" I would like the "2" in D2 to become a variable so it take its info from another cell. i.e. I want to enter a number in cell F20 , lets say 15. to replace the "2" in D2. So now my formula would get info from cell F20 and excel would see it as D15 now. I tried put it in brackets and quotes and I cant see to get it to work. can anyone help.

    thanx
     
  2. CodeLexicon

    CodeLexicon

    Joined:
    Oct 15, 2013
    Messages:
    503
    You need the indirect function Replace all instances of:

    Code:
    Estimate!D2
    With

    Code:
    Indirect("Estimate!D"&(F20))
     
    Last edited: Mar 3, 2016
  3. nomad

    nomad Thread Starter

    Joined:
    Sep 30, 1999
    Messages:
    386
    that worked great... thx
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1167223

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice