+ Reply to Thread
Results 1 to 6 of 6

Additional condition for sum product

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Additional condition for sum product

    Hi

    I managed to get the formula below working:
    =SUM(SUMIF(INDIRECT("'"&D4&"'!"&"$A$6:$A$54"),E4:X4,INDIRECT("'"&D4&"'!"&"$C$6:$D$54")))

    However I missed a requirement. Currently it looks within a range on the summary sheet EX:X4. Most of these have two digits e.g. "JA", ","JB","JD" etc which the formula works for.

    BUT, also within this range are single digits e.g. "H" - what I would like a formula to do is sum all the instances on the sheet to be summed which start with the Letter e.g. in this example of "H" on the summary sheet I would need it to sum "HA", "HB" and "HC" on the sheet APP024

    Can anyone help?
    Attached Files Attached Files

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

    Re: Additional condition for sum product

    Try it like this in AA4:

    =SUM(SUMIF(INDIRECT("'"&D4&"'!"&"$A$6:$A$54"),E4:X4&IF(E4:X4="H","*",""),INDIRECT("'"&D4&"'!"&"$C$6:$D$54")))

    (new bits added in red). Use CSE to commit the formula, then copy down.

    Hope this helps.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Additional condition for sum product

    Many thanks Pete for this - it works.

    I need to be annoying and change the requirement slightly. In the formula you provided it currently looks for the creiteria "H" only.

    Is there any way in which it could look up other single and apply the same logic e.g. if there was a cell with just "A" then I would need it to look up all instances of A*

    In my data I have single instances of A/H/K/X but there could be more. Would I need to add each condition or could a formula exist which would look up the length of the cell then if 1 it would then use the cell and "*"?

    Hope that makes sense?

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

    Re: Additional condition for sum product

    Okay, slight amendment, shown in red:

    =SUM(SUMIF(INDIRECT("'"&D4&"'!"&"$A$6:$A$54"),E4:X4&IF(LEN(E4:X4)=1,"*",""),INDIRECT("'"&D4&"'!"&"$C$6:$D$54")))

    Hope this helps.

    Pete

  5. #5
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Additional condition for sum product

    It does - Thank you!!

    Works brilliantly

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

    Re: Additional condition for sum product

    Glad to help - thanks for the rep.

    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. Adding additional IF condition
    By dannyjoer in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-28-2014, 10:10 AM
  2. [SOLVED] Include an additional product in a sumproduct formula
    By cpope in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2013, 11:18 AM
  3. [SOLVED] VLOOKUP??? With additional condition??
    By wpnsx in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-11-2013, 12:48 PM
  4. Add additional condition to this code
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-14-2012, 03:58 PM
  5. COUNTA-formula with additional condition
    By BCB in forum Excel General
    Replies: 5
    Last Post: 12-14-2006, 02:48 PM

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