+ Reply to Thread
Results 1 to 15 of 15

Checking subtotals with varying entries

  1. #1
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Checking subtotals with varying entries

    Hi,

    Please see attached.

    Entries in column B indicate a new entry. What I need to do is to check that the sum of values in column G equal the corresponding value in column B. So, Entry B is incorrect for example, as 40,20 & 30 does not equal.

    In the real example, here are hundreds of enties. Each entry has varying numbers of rows.

    Any assistance would be great.

    Thanks.
    Attached Files Attached Files
    Last edited by bd528; 06-23-2009 at 09:00 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Checking subtotals with varying entries

    Assuming values in B are text then the below will work:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Amazing, thank you.

    You've just made my day at work far less stressful

  4. #4
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Hi,

    I tried to use the code in the real example, but I'm struggling. Plus there is an additional factor now.

    Please see attached.

    Now I need the forumla to show :-

    "Correct" if the total of column M (per section) plus the value in column D equals column C - otherwise "Wrong" (as per my example)

    Many thanks.

  5. #5
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Sorry, forgot attachment...
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Checking subtotals with varying entries

    Your references:

    "Correct" if the total of column M (per section) plus the value in column D equals column C - otherwise "Wrong" (as per my example)
    ..don't tie out to your example file

    Do you mean: check value in Ex = Dx where Bx is not blank ?

    Might make sense to post some examples where the results are Wrong - whether that be the result of the values not totalling per Group or the other condition is not met.

  7. #7
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Sorry about that, I attached the wrong file.

    There are some examples of wrong and right.

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Checking subtotals with varying entries

    OK so

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Thats works great.

    Thanks again for your help. Very clever stuff.

    How can I flag this thread as solved?

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Checking subtotals with varying entries

    No problem

    See FAQ / How To ? for info. on marking threads Solved.

  11. #11
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Maybe you might be able to help with 2 more possible ammendments? Sorry I should have thought the query through before my original post...

    (This may over-complicate the formula)

    Please see attached

    In column E, where the value for the section is IRISTD, I'd like the formula to ignore the value in column D. So the comparison should just be against the total of column M and the value in column C.

    Secondly, I recorded a macro to insert a column, paste the formula, and then copy it down. Is there a way to stop the formula being copied once it reaches the last row? (row 12 in my example)

    The code I'm using at the moment is

    Please Login or Register  to view this content.
    Thanks again

  12. #12
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Checking subtotals with varying entries

    No attachment...

  13. #13
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    I'm sure I attached it that time!

    Here you go...
    Attached Files Attached Files

  14. #14
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Checking subtotals with varying entries

    Based on my understanding:

    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Checking subtotals with varying entries

    Yep, that worked perfectly again. And the macro generated the results even faster.

    Thanks again for your time and effort

    Solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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