Calculate using a cell address that increases

kcompton

Board Regular
Joined
Mar 16, 2009
Messages
209
Hi - I am trying to calculate 200000 minus a number in a cell address that changes when I insert an additional row.
For example,
200,000 minus D3. (D3 is the sum of the range D1:D2)
but then I insert a row and the calculation has to become
200000 minus D4 (where D4 is the sum of the range D1:D3)

Thanks for any help -
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,745
Office Version
365
Platform
Windows
Is the cell you want to subtract ALWAYS the last cell in thet column?

There are a number of options, including:
1. Change the structure of your workbook, so that the SUM is at the top, instead of at the bottom (so that row won't move as rows are inserted).
2. Make it a named range and reference it that way (the named range will automatically move as you insert row).
3. Use a formula that returns the last cell in the column (see: https://exceljet.net/formula/get-value-of-last-non-empty-cell)
 

kcompton

Board Regular
Joined
Mar 16, 2009
Messages
209
Thank you Joe4 -
Yes, the cell is Always the last cell in the column.
I previously tried the Lookup option, but not in the correct format referenced int the link you provided.
Thank you so much for your help.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,745
Office Version
365
Platform
Windows
You are welcome.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,840
Messages
5,489,196
Members
407,677
Latest member
Matt1989

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top