+ Reply to Thread
Results 1 to 3 of 3

Sums of varying number of cells. Sums of parts of a column depending on content

  1. #1
    Registered User
    Join Date
    01-04-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2016
    Posts
    12

    Sums of varying number of cells. Sums of parts of a column depending on content

    For each asset there are an acquisition record and multiple depreciation records. In the next column I'd like to add up the acquisition with the depreciations for each asset to get the asset's current residual value. There are different numbers of depreciations for different assets.

    Is there a way to do this with cell formulas, without writing Visual Basic code? Can I with a cell formula figure out how many depreciations there are for each asset, and add them up? One approach might be to add up all cells in a column with a negative value until a cell with a positive value is encountered, then start another summation. Each asset has a common ID for its acquisition and depreciations.

    Schematic of three columns:

    ID1 +Acquisition
    ID1 -Depreciation
    ID1 -Depreciation
    ID1 -Depreciation = Residual value
    ID2 +Acquisition
    ID2 -Depreciation
    ID2 -Depreciation
    ID2 -Depreciation
    ID2 -Depreciation
    ID2 -Depreciation = Residual value
    ID3 +Acquisition
    ...
    Last edited by lotsof; 10-25-2019 at 07:23 AM.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Sums of varying number of cells. Sums of parts of a column depending on content

    if the data is sorted as outlined (by ID) then:

    C2: =IF($A2=$A3;"";SUM($B$2:$B2)-SUM($C$1:$C1))

    where first ID value appears in row 2, and row 1 is header / blank

    in essence the above will calculate a total for last entry of a given ID, and the total will be equal to the net of Column B to that point (for all IDs) less the sum of any previously calculated residual totals, {the difference must be the residual of the current ID}.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Sums of varying number of cells. Sums of parts of a column depending on content

    It would help if you attached a sample Excel workbook, then we can set up the formula in the correct column and post the solution back to you where it will be translated into Swedish for you.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Don't try to use the Paperclip icon, as it doesn't work on this forum.

    Hope this helps.

    Pete

+ 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. [SOLVED] Formula to add sums out of columns depending on a corresponding serial number from another
    By bdouglas1011 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-11-2017, 03:47 AM
  2. [SOLVED] Multiple Sums/Subtotal with changing number of cells between
    By woodrrow in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-11-2017, 07:52 PM
  3. [SOLVED] Sums according to the content of fields
    By bj in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 07:05 AM
  4. [SOLVED] Sums according to the content of fields
    By bj in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  5. Sums according to the content of fields
    By James1976 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. [SOLVED] Sums according to the content of fields
    By James1976 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] Sums according to the content of fields
    By James1976 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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