+ 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
    78

    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 Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    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
    78

    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 Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    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
    78

    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 2016
    Posts
    9,409

    Re: sum by searching up based on a different column

    Try in D3:

    Please Login or Register  to view this content.
    Quang PT

+ 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. Populating a field based on searching a column
    By VladDracule in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 12:02 PM
  2. Replies: 6
    Last Post: 08-20-2015, 03:30 AM
  3. [SOLVED] Search for a column based on a header name and then searching only that column
    By sokeefe14 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-12-2015, 10:51 AM
  4. Replies: 1
    Last Post: 11-22-2012, 04:43 AM
  5. [SOLVED] Cull rows based on searching for text in a column.
    By pthielan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-06-2012, 08:31 PM
  6. Searching an entire column for all the values existing in a nother column
    By Dynelor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2007, 06:20 PM
  7. Searching Column A and puting a check mark in Column B
    By airhendrix13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2006, 05:17 PM

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