+ Reply to Thread
Results 1 to 12 of 12

Help to create a new SUM IF Formula

  1. #1
    Forum Contributor
    Join Date
    03-14-2017
    Location
    london, england
    MS-Off Ver
    office 365
    Posts
    173

    Help to create a new SUM IF Formula

    Hi Im looking to add a new search parameter to my spreadsheet.

    In columns A:G i enter data based on specie/ size/ presentation/ weight/ box/ price.

    In columns M:P based on the specie i have index and sumif functions to pick out the amount of boxes/ kilos of each species based on the data i have already entered

    I now want to add a new perameter which seperates specie based on presentation.

    Example

    M7 = COD N7= GH O7=64 P7=2240
    M8 = HAD N8=GH O8=29 P8= 1160
    M9 =HAD N9=WF O9=24 P9=960
    Attached Files Attached Files
    Last edited by Dom.Knight; 03-23-2020 at 03:57 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Help to create a new SUM IF Formula

    SUMIFS instead of SUMIF

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Help to create a new SUM IF Formula

    Perhaps if you show some expected answers?

    Also, is the formula in M pulling out unique entries, I see it is searching for criteria in B that dont exist (species and 0)?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    03-14-2017
    Location
    london, england
    MS-Off Ver
    office 365
    Posts
    173

    Re: Help to create a new SUM IF Formula

    Ive updated my attachment to show the results to which im looking for in columns R:U.

    The formula in M is only picking out species which are in column B and ignores the two sub headings located in rows 47:50 and 93:96

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Help to create a new SUM IF Formula

    Apologies, but still not sure which data you want extracted, and which is criteria?

    Have you considered/tried using a PIVOT TABLE for this?
    M
    N
    O
    P
    Q
    R
    S
    T
    16
    Sum of Total (Kg) Column Labels
    17
    Row Labels
    1
    4
    10
    12
    24
    25
    Grand Total
    18
    COD
    35
    140
    350
    840
    875
    2240
    19
    GH
    35
    140
    350
    840
    875
    2240
    20
    HAD
    40
    160
    1920
    2120
    21
    GH
    40
    160
    960
    1160
    22
    WF
    960
    960
    23
    WHG
    1080
    1080
    24
    GH
    540
    540
    25
    WF
    540
    540
    26
    Grand Total
    75
    300
    350
    1080
    2760
    875
    5440

  6. #6
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Help to create a new SUM IF Formula

    I added a helper column and generates a unique list of combinations out of that.
    Then I used SUMIFS for collecting the data (see attached file)
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-14-2017
    Location
    london, england
    MS-Off Ver
    office 365
    Posts
    173

    Re: Help to create a new SUM IF Formula

    Hello and thanks for the replies but thats still not quite what im looking for.

    In the data set which is columns A:G, I have enterned a merchant/ specie/ size/ gutted or whole/ number of boxes/ box weight/ box price.

    For some species they will have both "GH/ WF" marked against them depending on the size.
    For Exmaple row 14 and 15 both show specie "had" size "4" with "gh" and "wf" marked against them.

    What im trying to achive is a formulae that will show the total kilos for gh had and wf had.(for every specie that may have this)
    My current formulae in columns M:P adds up the total kilos and boxes for each specie that is entered however it does not seperate between gutted and whole fish (GH/ WF)

  8. #8
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: Help to create a new SUM IF Formula

    M
    N
    O
    P
    3
    species
    Presentation
    boxes
    Total (Kg)
    4
    5
    6
    7
    COD GH
    64
    2240
    8
    HAD GH
    29
    1160
    9
    HAD WF
    24
    960
    10
    WHG GH
    12
    540
    11
    WHG WF
    12
    540


    M7=IFERROR(INDEX(B$7:B$46,SMALL(IF(FREQUENCY(IF(B$7:B$46<>"",MATCH($B$7:$B$46&$C$7:$C$46,$B$7:$B$46&$C$7:$C$46,0)),ROW(B$7:B$46)-ROW(B$7)+1),ROW(B$7:B$46)-ROW(B$7)+1),ROWS($B$7:$B7))),"")

    Control+shift+enter

    copy across and down



    O7=IF($M7<>"",SUMIFS($E$7:$E$46,$B$7:$B$46,$M7,$C$7:$C$46,$N7),"")

    copy down


    P7=IF($M7<>"",SUMIFS($J$7:$J$46,$B$7:$B$46,$M7,$C$7:$C$46,$N7),"")


    copy down

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Help to create a new SUM IF Formula

    Please try at
    M7:N7
    =IFNA(INDEX(B$7:B$102,MATCH(0,-ISNUMBER(MATCH($B$7:$B$102&$C$7:$C$102,$M$3:$M6&$N$3:$N6,)),)),"")

    O7
    =IF(M7="","",SUMIFS(E$7:E$102,$B$7:$B$102,$M7,$C$7:$C$102,$N7))

    P7
    =IF(N7="","",SUMIFS(J$7:J$102,$B$7:$B$102,$M7,$C$7:$C$102,$N7))

    or fews click with PIVOT
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    03-14-2017
    Location
    london, england
    MS-Off Ver
    office 365
    Posts
    173

    Re: Help to create a new SUM IF Formula

    CARACALLA :- Yes thats what im looking for however is there away to adapt the formulae in M7 to ignore the sub headings in my attachment which are located in rows 47:50 and 93:96.

    And also if i change numbers in column E to decimal is there away to include a round up formulae aswell.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    03-14-2017
    Location
    london, england
    MS-Off Ver
    office 365
    Posts
    173

    Re: Help to create a new SUM IF Formula

    BO_RY:- Yes what im looking for aswell. can your formulae be adjusted as my post above.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Help to create a new SUM IF Formula

    Try making the following modification to the array entered formula in cell M7. After activation*, drag the fill handle over to cell N7 and then, while M7:N7 are still selected, double click the right mouse button to copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Array entered formulas need to be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER before being copied.
    Try making the following modification to the formula that populates column O: =IF($M7<>"",ROUNDUP(SUMIFS($E$7:$E$150,$B$7:$B$150,$M7,$C$7:$C$150,$N7),0),"")
    When I tested the formulas columns M:P displayed the same output as that which is in columns R:U with the exception of cell P7. Doing a bit of filtering it would appear that P7 displays the correct result.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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 create list of items selected for reports (array formula?)
    By Cidona in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-06-2018, 02:09 AM
  2. [SOLVED] Can I create a formula and drag the cell and duplicate the formula?
    By attroll in forum Excel General
    Replies: 10
    Last Post: 11-28-2016, 01:14 PM
  3. [SOLVED] VBA to create a relative formula in a conditional format (rather than an absolute formula)
    By The_Snook in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2016, 08:00 AM
  4. Replies: 4
    Last Post: 07-16-2013, 10:32 AM
  5. [SOLVED] I want to create a formula in one sheet, that will function as a formula in other sheets
    By johnw993 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2013, 07:07 PM
  6. Replies: 7
    Last Post: 08-22-2005, 08:05 AM
  7. Replies: 2
    Last Post: 07-01-2005, 02:05 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