Dynamic formula for subtracting from two different cells.

Ali3ta1r

New Member
Joined
Nov 24, 2020
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am not sure if this is a simple question but seeking some advice on the below.

Is there a simple subtraction formula I can use between 2 cells that would work/update accordingly on visible data only?

At the moment I am using =A1-A2, but when I filter this it still accounts for the hidden data,

Kind Regards,
Alistair
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You could consider SUBTOTAL but it only supports SUM (among other functions, just no subtract capability). So, one workaround would be to enter in B2 the formula =-A2 and then use SUBTOTAL with A1 and B2. For more on SUBTOTAL check Google or Excel help.
 
Upvote 0
I think You can Use Subtotal function With Function Number 109, Example:
=A1-A2 converted to =SUBTOTAL(109,A1)-SUBTOTAL(109,A2)
 
Upvote 0
I think You can Use Subtotal function With Function Number 109, Example:
=A1-A2 converted to =SUBTOTAL(109,A1)-SUBTOTAL(109,A2)
I have just tried this and it hasn't worked as hoped.

I have attached a screenshot that I hope helps show what I am trying to achieve.

Essentially what I am trying to do is this:

1. When I filter "Column K" by Account, I would like "Column M" and "Column P" to update using only the filtered data.
2. To clarify, both "Column M" and "Column P" are dynamic values.
3. "Column M" is always calculated from the above line's corresponding value in "Column P" SUBTRACTING "Column L" (the Stake which is always £1.00)
4. "Column P" is calculated from the SUM of the same line's corresponding values in "Colum M, N & O".

I hope you can see from the attached photo that when I use the formula above, I always get -£1.00 in "Column M" (New Bank). Which is not correct, it should be the value of the above lines corresponding "Column P" value minus "Column L" (Stake). So in the photo attatched, Cell M3 should be P2-L3 (which should equal £20.00).

I hope that is clear? Any advice on how to achieve this?
 

Attachments

  • Untitled.png
    Untitled.png
    8.5 KB · Views: 12
Upvote 0
Please Use XL2BB to upload 4-5 row example of your files to we know what is your formula and if possible correct it.
You see XL2BB at above of new message section when you want write.
In that Situation M3 = N2 . Is correct this?
When all data in Column L is equal, Why M3=P2-L3 , why not M3= P2-L2
Are your format number is correct? M3 equal to:
=SUBTOTAL(109,P2)-SUBTOTAL(109,L3)
 
Last edited:
Upvote 0
Upvote 0
I hope this helps, this is what I was using before and wasn't working as I require.

To clarify, I would like to be able to filter the data on "Column K" (Accounts) so the values in "Columns M, N O & P" update accordingly.

Difficult to explain, but any Q's please let me know and I'll do my best.
 
Upvote 0
Upvote 0
And here's the 2nd one when I try to use the Subtotal formula.

Column M values are all wrong, which then makes Column P wrong.

i.e. M4 should be P3-L3 (equalling £10.49) and then P4 should be the sum of M3, N3 & O3 (in this instance still £10.49).

Then as noted above, I would like to be able to filter by Column K (Accounts) so that all the cells still calculate the same but only using the visible data.
 
Upvote 0
I see Red alerts on the column M, N, O & P. what did They tell?(Topleft corner of each cell)
I see N2=L2*(I2-1) what is I .
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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