Running total, maybe SUMIFS??

krispatterson

Board Regular
Joined
Apr 28, 2017
Messages
51
Hi all

data as follows:

ABCD
1105N
251N
3612Y
413N
51413Y

<tbody>
</tbody>


I need a formula in D1 that:

> Looks at Column C
- if "N", puts the figure from Column A as a - (negative).
- if "Y", puts the figure from Column B as a + (positive).

I then want it to run a cumulative running total, so that the results in Column D are:
D
1-10
2-15
3-3
4-4
510

<tbody>
</tbody>


There will also be instances where Column C is blank - I need the formula to ignore those instances.



Hope that makes sense - I think I might need a SUMIFs, but can't figure out how to get it working!!

Thanks in advance
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Least complex way would be to add a helper column with =IF(D2="y",+C2,IF(D2="n",-B2,"")), then you can use =SUM($E$2:E2) in the next column and copy them down.
 
Last edited:
Upvote 0
I think your last 10 should be 9. You could try these two formulas. In D1:

=IF(C1="N",-A1,IF(C1="Y",B1,""))

In D2:

=IF(C2="N",-A2,IF(C2="Y",B2))+IF(D1<>"",D1)
 
Upvote 0
thanks to all - steve the fish, I used your formula and it works perfectly! & yes, you're right - my maths clearly leaves a bit to be desired :(
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top