+ Reply to Thread
Results 1 to 3 of 3

SumIF formula not working

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-05-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    163

    SumIF formula not working

    Hi All,

    I am having a bit of trouble with a SUMIF formula not working. See below formula

    Formula: copy to clipboard
    =IFERROR(IF(BR$2=0,0,IF(NOW()<BR$2,IF($B7=BR$3,BR7,IF(BR$2>=$B7,SUM(SUMIFS($J7:BR7,$J$3:BR$3,">="&$B7,$J$5:BR$5,"* - R"),SUM(SUMIFS($J176:CC176,$J$171:CC$171,">="&$B7,$J$173:CC$173,"* - R"))),SUM(SUMIFS($J7:BR7,$J$3:BR$3,"<"&$B7,$J$5:BR$5,"* - R")))),BV7)),"")


    Breakdown of the formula:

    Circular reference to make sure changes don't occur throughout the year - Works fine
    SumIFS
    1. to look at the date in B7 and add everything after that date (I've got the before in there as well but it's irrelevant, was using it on another spreadsheet)
    2. Look for either the letter "*- R" or "*- S". in row 5 - The section I cannot get to work.
    Picking up the "*- S" works but if I change the formula to the "R" it doesn't work and I have no idea why.

    Has anybody got any clues to why?

    Attached example workbook. Formula's in column D relate to the February column.

    TIA
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,949

    Re: SumIF formula not working

    Your merged cells are the problem. If we break down your SUMIFS

    SUMIFS($J7:BR7,$J$3:BR$3,">="&$B7,$J$5:BR$5,"* - S")

    This will sum all numbers in row 7 where the date in row 3 is >= B7. But you don't have a date in every column. You just have a date in column J, P, V, etc. The "* - S" works because the columns with "* - S" are also in the columns with the dates. In K5 for example, which ends in "- R", there is nothing in K3. You may have assumed that a reference to K3 would also include the date in J3 because the cells are merged, but that is not the way merged cells work.

    Merged cells are almost always a bad design choice. They can cause numerous problems and are universally decried by experienced Excel developers.

    Your problem is really in your data layout design. It makes everything you want to do more difficult. You should arrange your data like this, and then your formulas become trivial. I did not try to reverse engineer and rewrite the formulas for Feb 2022.

    Values as displayed
    Period
    S
    R
    Gtd
    Grth
    Acc. S
    Acc. R
    Apr-21
    No Update
    £0.00
    £0.00
    0
    £0.00
    £0.00
    May-21
    No Update
    £0.00
    £0.00
    0
    £0.00
    £0.00
    Jun-21
    £6,731.42
    £471.20
    £471.20
    0
    £9.00
    £0.63
    Jul-21
    £0.00
    £0.00
    £0.00
    0
    £9.00
    £0.63
    Aug-21
    £212.86
    £14.90
    £14.90
    0
    £221.86
    £15.53
    Sep-21
    £0.00
    £0.00
    £0.00
    0
    £221.86
    £15.53
    Oct-21
    £6,090.62
    £426.34
    £426.34
    0
    £6,312.48
    £441.87
    Nov-21
    £0.00
    £0.00
    £0.00
    0
    £9,458.08
    £662.07
    Dec-21
    £3,080.01
    £215.60
    £215.60
    0
    £12,538.09
    £877.67
    Jan-22
    £3,080.01
    £215.60
    £215.60
    0
    £12,538.09
    £877.67
    Feb-22
    £10,219.75
    £2,059.03
    £715.38
    1,344
    £0.00
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    11-05-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    163

    Re: SumIF formula not working

    That makes perfect sense and now it works, thank you!

    I would love to change the format but I don't think it's possible, I've got 150 different suppliers with 3 years worth of data. (It was quite a wide spreadsheet before but I am in the middle of overhauling and each year will have it's own table. that spreadsheet has links to an import tab to gather the spend each month and is then copied onto another document to figure out what the journal entries for Sage are.)

    I've spent literally months over the past few years trying to update the spreadsheet for ease of use, but to the best of my knowledge this is the best way I can think of. (Although it is forever changing.)

    If you have any other suggestions, I would be open to hearing them.

+ 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. 3D Sumif formula not working
    By Chris_Devon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-25-2022, 11:16 AM
  2. [SOLVED] SUMIF formula is not working?
    By cToth in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-21-2019, 07:07 PM
  3. vlookup plus sumif formula not working
    By jono121ukk in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-29-2016, 02:48 PM
  4. [SOLVED] My formula sumif/indirect formula is working perfect..except everything is 1 row off!
    By Nyolls in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2015, 01:12 PM
  5. [SOLVED] SUMIF Formula not working - returns zero which is not correct
    By pongmeister in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2015, 09:41 PM
  6. [SOLVED] SUMIF formula is not Working
    By RobOMor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2013, 03:51 AM
  7. SUMIF formula not working
    By bopsgtir in forum Excel General
    Replies: 4
    Last Post: 12-21-2010, 02:07 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