+ Reply to Thread
Results 1 to 7 of 7

Formula not working in one row but OK on other rows

  1. #1
    Registered User
    Join Date
    07-23-2021
    Location
    Leeds, UK
    MS-Off Ver
    Office 2010
    Posts
    5

    Formula not working in one row but OK on other rows

    The problem cells are in row19 colunm J & K
    The formula totals the current row and the three previous rows, colunm D and column G
    this works on row 20 but not in row 19.

    this is the formula:

    =IF(MOD(ROW(),4),"",SUM(OFFSET(D19,,,-4))) does not work

    =IF(MOD(ROW(),4),"",SUM(OFFSET(D20,,,-4))) This works


    Many thanks for your attention.

    Iain
    Attached Files Attached Files

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

    Re: Formula not working in one row but OK on other rows

    Your formula does exactly what is was written to do. However, there is not enough information to understand what it is you really want to do. What result do you want instead of what you are getting?

    Your formula starts with

    IF(MOD(ROW(),4)

    This is not a Boolean expression, that is, it does not return TRUE or FALSE. It returns a number. If the number is 0, it is treated as FALSE. Anything else is treated as TRUE.

    When this formula appears in row 20, MOD(ROW(),4) is 0, which is interpreted as FALSE, and you get the SUM as the result.

    When this formula appears in row 19, MOD(ROW(),4) is 3, which interpreted as TRUE, and you get a null string as the result.

    Why do you have this test at the beginning of the formula?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-23-2021
    Location
    Leeds, UK
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Formula not working in one row but OK on other rows

    The IF test is to ensure that the formula is only applied when the row is populated.

    I am trying to create subtotals every 4th row only when that row has been populated.

    Utility meter readings are taken and recorded every week.

    This is the first time I have touched Excel since I retired 12 years ago and my 75 yearold neurons are not what they were.

    Any help you can give will be gratefully recieved.

    Iain

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula not working in one row but OK on other rows

    If you want subtotals every 4th row, then you want data in row 19, 23, 27, etc., and not in 20.

    I am thinking you want this in J19, then fill down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Formula not working in one row but OK on other rows

    [deleted - didn't read the requirement properly]
    Last edited by Croweater; 07-23-2021 at 07:53 PM.

  6. #6
    Registered User
    Join Date
    07-23-2021
    Location
    Leeds, UK
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Formula not working in one row but OK on other rows

    Quote Originally Posted by 6StringJazzer View Post
    If you want subtotals every 4th row, then you want data in row 19, 23, 27, etc., and not in 20.

    I am thinking you want this in J19, then fill down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you

    Iain

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Formula not working in one row but OK on other rows

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Index,Match,CountIF Formula NOT working for removing duplicate rows frm Table- plz, Check?
    By sumans054 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2019, 11:28 PM
  2. If/Indirect formula stops working after a few rows.
    By Lester_1961 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-04-2018, 01:47 AM
  3. [SOLVED] Complete novece alert! Adding new rows stops formula working.
    By richimpulse in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-17-2013, 05:26 PM
  4. Concatenate Formula not working for all rows
    By jenkimbell in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-19-2012, 11:40 AM
  5. Replies: 8
    Last Post: 09-12-2012, 05:53 PM
  6. Replies: 2
    Last Post: 08-17-2012, 08:16 AM
  7. Index - Match - ROWS formula not working?
    By marvinlajiant in forum Excel General
    Replies: 5
    Last Post: 10-12-2011, 11:26 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