Excel Table Functionality: lookup previous row

Anonymous
2024-05-16T20:09:02+00:00

Hi All,

I have a problem that I want to solve using the Table functionality. Please see screenshot

In the first column I have the turnover and in the second column the running total of the turnover.

What I to achieve, in my table i.e. in column H is what I have in column J, see formula:

=IF(Table1[@[Running Turnover]]>Table1[@[Fixed Amount]],Table1[@[Running Turnover]]-Table1[@[Fixed Amount]],0)-SUM($J$3:J3)

This formula is copied down from J3 to J15

The logic is as follows:

Ifd running total > Fixed amount, choose the amount in column D. Exception: if this first instance of the running total > Fixed amount occurs make the following calculation:

Turnover - (Fixed amount – Running turnover of the previous row).

So in this case in J12 the answer is 46 – (350 – 332) = 28

Can you help me building the required the formula, please? Or is this not possible at all in the Table function of Excel, as I have been working on it for some time now.

Please see the link to the spreadsheet here: https://docs.google.com/spreadsheets/d/1fpWnjJOcn0DNxl7HpNBrmHIttrH4mL8p/edit?usp=drive_link&ouid=110294040238289903125&rtpof=true&sd=true

Thanks,

 Excel

Naveen

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Ashish Mathur 100.9K Reputation points Volunteer Moderator
    2024-05-16T23:14:17+00:00

    Hi,

    Enter this formula in cell H3 and drag down

    =IF([@[Running Turnover]]>[@[Fixed Amount]],[@[Running Turnover]]-[@[Fixed Amount]],0)-SUM($H$2:H2)

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-05-17T07:15:07+00:00

    Hi Ashish,

    Thanks for your time and efforts.

    The formula you suggested is the same formula I put in my question, right? The reason why I am not using my formula is that it gave a circular and did not use the second row as it was the header. However, I tried it and it worked.

    Thanks,

    Naveen

    0 comments No comments
  2. Ashish Mathur 100.9K Reputation points Volunteer Moderator
    2024-05-17T07:39:25+00:00

    You are welcome.

    0 comments No comments