+ Reply to Thread
Results 1 to 4 of 4

Formula that uses Previous Sheet name

  1. #1
    Registered User
    Join Date
    07-15-2014
    Location
    Vancouver Island, Canada
    MS-Off Ver
    2007
    Posts
    1

    Lightbulb Formula that uses Previous Sheet name

    I have created an excel workbook (2007) with multiple pages for payroll hours submission. Each sheet accrues flex time and I need this accrual to carry forward to the next pay period. I would like a formula that will use the name of the previous tab in the current sheet. Current formula is:

    ='May 15 - May 30'!J25

    Unfortunately, I have to manually update each formula with the sheet name. Is it possible to build a formula that will do this for me?

    ~Amy
    Last edited by JBeaucaire; 07-15-2014 at 05:53 PM. Reason: Corrected title. Please read and follow the Forum Rules, link in the menu bar above. Thanks.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula that uses Previous Sheet name

    See if you can adapt the technique used here:

    https://www.excelforum.com/showthread.php?t=1000626
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula that uses Previous Sheet name

    You could use a UDF:

    Please Login or Register  to view this content.
    For your example,

    =OtherSheet("J25")

    ... returns the value of J25 on the prior sheet.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,477

    Re: Formula that uses Previous Sheet name

    Assuming that you have a date from the current month on the sheet in, say, cell A2, you could use INDIRECT to determine the previous and next month's sheet names.



    A
    B
    C
    D
    1
    This Month
    Last Month
    Next Month
    2
    February
    Jan 01 - Jan 31
    Mar 01 - Mar 31
    3
    February
    January
    March
    4
    =J25
    5
    =INDIRECT("'" & B$2 & "'!J25")
    6
    =INDIRECT("'" & C$2 & "'!J25")
    7
    8
    B2:
    Last Month
    9
    =TEXT(DATE(YEAR($A2),MONTH($A2)-1,1),"mmm dd") & " - " & TEXT(DATE(YEAR($A2),MONTH($A2),0),"mmm dd")
    10
    11
    C2:
    Next Month
    12
    =TEXT(DATE(YEAR($A2),MONTH($A2)+1,1),"mmm dd") & " - " & TEXT(DATE(YEAR($A2),MONTH($A2)+2,0),"mmm dd")
    13



    Cell A2 contains 01/02/2014, 1 February, 2014.

    B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    C3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    See the attached example workbook.


    Regards, TMS
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Help indirect and mid formula referencing previous sheet
    By Shan1monkey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2013, 01:14 PM
  2. How to write a formula which accesses the just previous sheet
    By jsingh125 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2012, 07:35 AM
  3. Replies: 1
    Last Post: 02-01-2012, 08:03 AM
  4. Date Formula on each sheet referring to previous sheet
    By simpson in forum Excel General
    Replies: 4
    Last Post: 04-19-2010, 04:48 PM
  5. [SOLVED] replace formula references with previous sheet names
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2006, 09:35 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