+ Reply to Thread
Results 1 to 6 of 6

sum by searching up based on a different column

  1. #1
    Registered User
    Join Date
    04-05-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    74

    sum by searching up based on a different column

    I want sum based on key t in total column. The logic is as shown in the figure

    The Total column should sum the data by searching up the t in key column

    How do we achieve this in the Total field?
    Attached Images Attached Images
    Last edited by melvinkoshy; 04-04-2019 at 11:59 PM.

  2. #2
    Forum Moderator Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    7,414

    Re: sum by searching up based on a different column

    In D3 =IF(B3="t",SUM($C$3:C3),"")
    In D4 =IF(B4="t",SUM($C$3:C4)-SUM($D$3:D3),"") and pull down as needed

  3. #3
    Registered User
    Join Date
    04-05-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    74

    Re: sum by searching up based on a different column

    As I preferred a structured formula for the table, I modified the key flag to a number instead of t and used the formula in Cell D3
    IF(B4<>"", SUM(C3:INDEX(C:C, MATCH(1E+99, B$1:B3))), "")

    However, I am not getting the total when there are multiple cells to be added. Total should appear corresponding to the cell where 1 is present in the key. Please help tweak the code?
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Forum Moderator Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    7,414

    Re: sum by searching up based on a different column

    Whats is wrong with the provided answer?

  5. #5
    Registered User
    Join Date
    04-05-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    74

    Re: sum by searching up based on a different column

    i desire the total to be against the same row as the "key"

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    4,939

    Re: sum by searching up based on a different column

    Try in D3:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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