+ Reply to Thread
Results 1 to 7 of 7

Variable in excel formula

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    16

    Question Variable in excel formula

    Hi all,

    I am wondering if it is possible to insert a variable inside an excel formula?

    This particular formula comes from a graph I am trying to set up:

    =SERIES(,'Stocks perf'!$AF$6:$AF$18,'Stocks perf'!$AI$6:$AI$18,1)

    Is it possible to make the bold area a variable? ie:

    =SERIES(,'Stocks perf'!$AF$6:$AF$18,'Stocks perf'!$AI$6:$AI$X,1)

    Thank you guys!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Variable in excel formula

    Perhaps this?

    http://www.techrepublic.com/blog/mic...arts-in-excel/
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    04-03-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Variable in excel formula

    Thanks Fotis1991,

    Is there no more straightforward way to do it?
    Plus, this graph is going to be replicated various times in various spreadsheets so I would like to avoid Defined Names as much as possible.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Variable in excel formula

    My knowledge about charts is limited!

    No other ideas. Hope someone will be able to helps you more. Good luck.

  5. #5
    Registered User
    Join Date
    04-03-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Variable in excel formula

    I was thinking about something like:

    To get this result:

    =SERIES(,'Stocks perf'!$AF$6:$AF$18,'Stocks perf'!$AI$6:$AI$18,1)

    I use this formula:

    =SERIES(,'Stocks perf'!$AF$6:$AF$18,'Stocks perf'!$AI$6:$AI$&INDIRECT($F$2),1)

    Where F2 links to a cell which values equals 18.

    No luck for the moment, it is not working.

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Variable in excel formula

    INDIRECT should point to a cell or range not part of a range.
    Try this

    =SERIES(,'Stocks perf'!$AF$6:$AF$18,INDIRECT("'Stocks perf'!$AI$6:$AI$"&$F$2),1)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  7. #7
    Registered User
    Join Date
    04-03-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Variable in excel formula

    I get "That function is not valid" as a result :/

+ 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. Use variable in excel formula
    By batchjb69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-18-2013, 01:16 PM
  2. Variable in an excel marco sum formula
    By dwhite0829 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2011, 04:24 PM
  3. How to add variable in cells.formula of excel?
    By navneet dusaj in forum Excel General
    Replies: 2
    Last Post: 02-28-2011, 10:12 AM
  4. How do I use a simple variable in an Excel formula?
    By Odyssey3d in forum Excel General
    Replies: 5
    Last Post: 07-26-2010, 01:16 AM
  5. [SOLVED] Variable in Excel Sum formula
    By KMR in forum Excel General
    Replies: 2
    Last Post: 03-27-2006, 04:10 PM

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