+ Reply to Thread
Results 1 to 21 of 21

SUMIF function + skipping 1 column

  1. #1
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    SUMIF function + skipping 1 column

    Hi there,

    I got a SUMIF function, that needs to skip 2 columns in each following cell. I have highlighted the part of the range that needs to change in orange for better visual.

    For example:

    I input in cell D3 the following formula
    =SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!$C$3:$C$5000)+SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!$D$3:$D$5000)

    And when I drag to the right, to D4 I would like to see the following formula:
    =SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!$E$3:$E$5000)+SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!$F$3:$F$5000) and so on. Eventually the formula will be dragged from:to D3:Z5000

    I have a feeling it will be something related to OFFSET, but I'm not skilled enough in Excel to get this to work :/

    Can someone help?

    Thank you in advance!
    Last edited by Echo4211; 06-09-2021 at 09:49 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    Deleted by JT
    Last edited by JohnTopley; 06-03-2021 at 04:10 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,257

    Re: SUMIF function + skipping 1 column

    If to right only change $
    =SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!C$3:C$5000)+SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!D$3:D$5000)

    If down
    =SUMIF('Sheet1'!$B$3:$B$5000;C$3;Offset('Sheet1'!$C$3:$C$5000,,row(A1)-1)+SUMIF('Sheet1'!$B$3:$B$5000;C$3;Offset('Sheet1'!$D$3:$D$5000,,row(A1)-1)
    "ThankyouFor Attention * And Your Help!!"

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: SUMIF function + skipping 1 column

    without OFFSET
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,401

    Re: SUMIF function + skipping 1 column

    D3 cell formula , drag it down

    HTML Code: 

  6. #6
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    Quote Originally Posted by daboho View Post
    If to right only change $
    =SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!C$3:C$5000)+SUMIF('Sheet1'!$B$3:$B$5000;C$3;'Sheet1'!D$3:D$5000)

    If down
    =SUMIF('Sheet1'!$B$3:$B$5000;C$3;Offset('Sheet1'!$C$3:$C$5000,,row(A1)-1)+SUMIF('Sheet1'!$B$3:$B$5000;C$3;Offset('Sheet1'!$D$3:$D$5000,,row(A1)-1)
    Hey, thank you for your reply, when I remove the $ symbols in front of the letters, then it only changes 1 column, not two. I want C to jump to E, and I want D to F, and then E to G and F to H, if you get my drift?

    Just to give additional information, the cell needs to be dragged to the right. Also, when I tried the pull down formula that you provided, I get an error saying "The formula is missing an opening or closing parenthesis.", and it's pointing out to the last -1) part of the formula, but anyhow, it needs to change 2 columns, when dragged to the right.

  7. #7
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    Quote Originally Posted by ChemistB View Post
    without OFFSET
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Doesn't seem to do anything, just to be clear, I am dragging this formula to the right, cause I see "ROWS", and I assume it's meant to be Columns, but after changing it I get an #SPILL! error, but both ways the formula doesn't work, except for the initial cell itself :/

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    Answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.

  9. #9
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    I have added a file to this post (I hope), with an example, basically I want in the tab "Overview" the range in the SUMIF change as followed when dragging to the right, eventually 'John Smith' will be x1000 of other names, so this formula will be continued on C4:C5000 eventually.:

    C3: =SUMIF(Detailed!$B$3:$B$15;Overview!$B3;Detailed!$C$3:$C$15)-SUMIF(Detailed!$B$3:$B$15;Overview!$B3;Detailed!$D$3:$D$15)
    D3: =SUMIF(Detailed!$B$3:$B$15;Overview!$B3;Detailed!$E$3:$E$15)-SUMIF(Detailed!$B$3:$B$15;Overview!$B3;Detailed!$F$3:$F$15)
    E3: =SUMIF(Detailed!$B$3:$B$15;Overview!$B3;Detailed!$G$3:$G$15)-SUMIF(Detailed!$B$3:$B$15;Overview!$B3;Detailed!$H$3:$H$15)

    C3: SUMIF calculates C - D
    D3: SUMIF calculates E - F
    E3: SUMIF calculates G - H
    Attached Files Attached Files
    Last edited by Echo4211; 06-08-2021 at 01:11 PM.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    Try

    in C3

    =SUMIF(Sheet1!$B$3:$B$50,$B3,INDEX(Sheet1!$C$3:$Z$50,MATCH($B3,Sheet1!$B$3:$B$50,0),COLUMNS($A2:A2)*2-1))-SUMIF(Sheet1!$B$3:$B$50,$B3,INDEX(Sheet1!$D$3:$Z$50,MATCH($B3,Sheet1!$B$3:$B$50,0),COLUMNS($A2:A2)*2-1))

  11. #11
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    Quote Originally Posted by JohnTopley View Post
    Try

    in C3

    =SUMIF(Sheet1!$B$3:$B$50,$B3,INDEX(Sheet1!$C$3:$Z$50,MATCH($B3,Sheet1!$B$3:$B$50,0),COLUMNS($A2:A2)*2-1))-SUMIF(Sheet1!$B$3:$B$50,$B3,INDEX(Sheet1!$D$3:$Z$50,MATCH($B3,Sheet1!$B$3:$B$50,0),COLUMNS($A2:A2)*2-1))
    Hey JohnTopley,

    At first glance, I have played around a bit on my example sheet, and it seems to work exactly how I want it for the first line, but when adding other names, the calculations seem to be off. How can I properly drag this cell downwards?

    Could it be related to the COLUMNS($A2:A2)*2-1) that jumps along? (Updated file in attachment)
    C4: =SUMIF(Detailed!$B$3:$B$50;$B4;INDEX(Detailed!$C$3:$Z$50;MATCH($B4;Detailed!$B$3:$B$50;0);COLUMNS($A3:A3)*2-1))-SUMIF(Detailed!$B$3:$B$50;$B4;INDEX(Detailed!$D$3:$Z$50;MATCH($B4;Detailed!$B$3:$B$50;0);COLUMNS($A3:A3)*2-1))
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    Not certain why SUMIFS failed si I reverted to the much more "robust" SUMPRODUCT

    =SUMPRODUCT((Detailed!$B$3:$B$50=$B3)*(INDEX(Detailed!$C$3:$Z$50,0,COLUMNS($A$2:A$2)*2-1)))-SUMPRODUCT((Detailed!$B$3:$B$50=$B3)*(INDEX(Detailed!$D$3:$Z$50,0,COLUMNS($A$2:A$2)*2-1)))

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: SUMIF function + skipping 1 column

    Try this in C3 copied across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    Missed the obvious of using "Product" as the index BUT is this the real situation ???
    Last edited by JohnTopley; 06-08-2021 at 04:23 PM.

  15. #15
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,401

    Re: SUMIF function + skipping 1 column

    If the form is so regular, the formula can be simple.

    worksheet name : Overview
    Cell C3 formula , Drag down and accross

    HTML Code: 

  16. #16
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    Quote Originally Posted by ChemistB View Post
    Try this in C3 copied across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thanks for your reply, the formula does work on the example sheet, but unfortunately certain products have identical names in my actual list, but needs to be calculated separately. I should of mentioned this in my initial post, my apologies for that.

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    Have you tried post #12?

  18. #18
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    Quote Originally Posted by JohnTopley View Post
    Have you tried post #12?
    I have already tried it, but I'm trying to figure out why it works PERFECTLY, but when I extend the range =SUMPRODUCT((Detailed!$B$3:$B$50=$B3) to =SUMPRODUCT((Detailed!$B$3:$B$50000=$B3) it gives N/As all over the screen

  19. #19
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    It seems to be working now, I just need to make sure that all the ranges (and not just one) go from 50 to 50000. It does slow down the Excel by a bit though, but it works

    Thank you JohnTopley, and everyone else for the help! I appreciate it!

  20. #20
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: SUMIF function + skipping 1 column

    SUMIF now corrected

    =SUMIF(Detailed!$B$3:$B$50,$B3,INDEX(Detailed!$C$3:$Z$50,0,COLUMNS($A2:A2)*2-1))-SUMIF(Detailed!$B$3:$B$50,$B3,INDEX(Detailed!$D$3:$Z$50,0,COLUMNS($A2:A2)*2-1))
    Last edited by JohnTopley; 06-09-2021 at 10:47 AM.

  21. #21
    Registered User
    Join Date
    06-03-2021
    Location
    Netherland
    MS-Off Ver
    MS365 v2105
    Posts
    12

    Re: SUMIF function + skipping 1 column

    Quote Originally Posted by JohnTopley View Post
    SUMIF now corrected

    =SUMIF(Detailed!$B$3:$B$50,$B3,INDEX(Detailed!$C$3:$Z$50,0,COLUMNS($A2:A2)*2-1))-SUMIF(Detailed!$B$3:$B$50,$B3,INDEX(Detailed!$D$3:$Z$50,0,COLUMNS($A2:A2)*2-1))
    Works as a charm, and feels way smoother Thanks again JohnTopley!

+ 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] Sumif function to total column e if text in column a appears in more than one row
    By SMITH.CRYSTAL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-23-2015, 03:58 PM
  2. Replies: 1
    Last Post: 05-21-2014, 04:30 PM
  3. how to copy function in a column skipping cells
    By sekernicek in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-02-2009, 09:26 AM
  4. [SOLVED] Improve SUMIF function to sum more than one column
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 07:05 PM
  5. [SOLVED] Improve SUMIF function to sum more than one column
    By Mark Rucker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  6. [SOLVED] Improve SUMIF function to sum more than one column
    By Mark Rucker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. Improve SUMIF function to sum more than one column
    By Mark Rucker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2005, 04:05 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