+ Reply to Thread
Results 1 to 8 of 8

How to produce a dynamic calculation in a P & L sheet?

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    Shropshire; UK
    MS-Off Ver
    365 Excel for Mac V16.28
    Posts
    28

    How to produce a dynamic calculation in a P & L sheet?

    Hi Folks

    I currently use a standard monthly profit & loss report which gives the monthly totals and cumulative totals as the year progresses. (sample attached)
    The monthly variance is simply C4-D4 for December and E4-F4 for January etc.
    I would like to know if there is a way these totals can be automatically produced monthly as the various numbers are inputted into the sheet, rather than having to manually enter the changed formulas?

    Thanks in advance for any suggestions.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: How to produce a dynamic calculation in a P & L sheet?

    Enter as an array formula (i.e. use CTRL-SHIFT-ENTER)
    =INDEX($C$4:$Z$4,MAX(COLUMN($C$4:$Z$4)*ISNUMBER(C4:$Z$4))-2)-INDEX($C$4:$Z$4,MAX(COLUMN($C$4:$Z$4)*ISNUMBER($C$4:$Z$4))-3)
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    12-26-2011
    Location
    Shropshire; UK
    MS-Off Ver
    365 Excel for Mac V16.28
    Posts
    28

    Re: How to produce a dynamic calculation in a P & L sheet?

    Hey Pauleyb

    That's just what I wanted, thank you so much.
    I've not come across array formulas before, but I'm going to get clued up now!

    Would I be correct in assuming that to copy this formula for the next entry down it would neccesitate changing $4 formula entries to $5, and so on?

    Much appreciated.
    Last edited by basils57; 08-24-2019 at 10:12 AM.

  4. #4
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: How to produce a dynamic calculation in a P & L sheet?

    If you want to copy it down, I would recommend changing the original formula's "$4" to just "4". This would allow it to change as you drag it down to lower rows.

    Use the 'Evaluate Formula' tool to see how it works. There are other ways to solve this problem, but they all involve a method to find the last data in the row (not including your totals). Using OFFSET and/or dynamic named ranges could be other methods. The problem with array formulae, is that they do take some time, and as the arrays get big, it can bog down excel. With your array size of just 24 cells, that should not be an issue.

  5. #5
    Registered User
    Join Date
    12-26-2011
    Location
    Shropshire; UK
    MS-Off Ver
    365 Excel for Mac V16.28
    Posts
    28

    Re: How to produce a dynamic calculation in a P & L sheet?

    Thanks again Pauleyb - I'd already worked out that the $ needed to be excluded, and the other info is very useful.

  6. #6
    Registered User
    Join Date
    12-26-2011
    Location
    Shropshire; UK
    MS-Off Ver
    365 Excel for Mac V16.28
    Posts
    28

    Re: How to produce a dynamic calculation in a P & L sheet?

    Hi again

    Although in my original post, I said that I wanted the variance of C4-D4, the formula appears to produce D4-C4. What change is require to the formula to produce this please, I can't fathom it?
    Last edited by basils57; 08-31-2019 at 11:38 AM.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: How to produce a dynamic calculation in a P & L sheet?

    Try reversing the 2 and the 3 so that the formula reads: =INDEX(C4:Z4,MAX(COLUMN(C4:Z4)*ISNUMBER(C4:Z4))-3)-INDEX(C4:Z4,MAX(COLUMN(C4:Z4)*ISNUMBER(C4:Z4))-2)
    Remember to activate by pressing the Ctrl, Shift and Enter keys.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Registered User
    Join Date
    12-26-2011
    Location
    Shropshire; UK
    MS-Off Ver
    365 Excel for Mac V16.28
    Posts
    28

    Re: How to produce a dynamic calculation in a P & L sheet?

    Many thanks for that JeteMc, much appreciated.

+ 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 with the best way to produce this sheet and report
    By inf0rm3r in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-29-2019, 01:05 PM
  2. Calculation problem to produce 3 different results from IF
    By mgxeab in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2013, 04:11 AM
  3. UserForm Check Box to Produce Value on one Sheet and Change format on another
    By wlugo13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-20-2013, 01:24 PM
  4. Just cant get this I need MAster Sheet to produce the field that does not read off
    By detailingking in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2013, 11:34 PM
  5. Replies: 1
    Last Post: 05-08-2012, 09:31 PM
  6. sales tax calculation formula to produce a chart?
    By Carmensita in forum Excel General
    Replies: 4
    Last Post: 05-15-2006, 09:25 AM
  7. produce a formulate to produce assigned seats for dinner
    By DavidJoss in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-03-2005, 10:05 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