+ Reply to Thread
Results 1 to 3 of 3

Replacing sheet number in a formula by cell reference

  1. #1
    Registered User
    Join Date
    08-07-2019
    Location
    India
    MS-Off Ver
    2007
    Posts
    21

    Replacing sheet number in a formula by cell reference

    Hi,

    I have a formula like this:

    SUM(Sheet2!A1:A5) in an excel sheet. I want to replace "2" in Sheet2 by a cell reference (A1) so that the formula automatically adjusts to get the required result, when the user want the sum from a random sheet.

    So, my current formula is this: =SUM(Sheet2!A1:A5)

    And I want something like this: =SUM(Sheet(A1)!A1:A5)

    Is this possible? How? Please help me.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Replacing sheet number in a formula by cell reference

    Try this:

    =SUM(INDIRECT("Sheet"&A1&"!A1:A5")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-07-2019
    Location
    India
    MS-Off Ver
    2007
    Posts
    21

    Re: Replacing sheet number in a formula by cell reference

    That works! Thanks.

+ 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. Replies: 5
    Last Post: 01-15-2016, 06:16 PM
  2. [SOLVED] Replacing formula with $ variable cell reference
    By PQK78 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 07-17-2015, 12:14 AM
  3. [SOLVED] Reference a sheet by number (not name) in a formula
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2013, 05:04 PM
  4. Replies: 3
    Last Post: 06-14-2011, 05:09 PM
  5. Prevent #REF from replacing sheet reference
    By XevetS in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-06-2008, 12:40 AM
  6. Replacing sheet reference in multiple cells...
    By neilcarden in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-23-2006, 12:10 PM
  7. Formula to reference sheet number base on cell
    By PCLIVE in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2005, 06:05 PM

Tags for this Thread

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