+ Reply to Thread
Results 1 to 29 of 29

Find sum relating to a cell

  1. #1
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Find sum relating to a cell

    I have a sum in a table that is repeated every row (over 8000 times), every now and then the sum randomly changes the cell it is looking for but I dont know how to highlight these so I can easily go in and correct.

    This is what it should be =COUNTIF(C$2:C2328,C2328) but every now and then it changed the middle number to row 8942 which is my last row of data =COUNTIF(C$2:C8942,C2327).

    1.Is there a way to highlight the cells where this has happened so I can correct
    2.How do I stop it happening gain!

    Thanks
    Nikki

  2. #2
    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,869

    Re: Find sum relating to a cell

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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.

  3. #3
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Find sum relating to a cell

    please see big yellow banner and upload your workbook - you are then more likely to get a solution - otherwise you will most likely get numerous informed guesses.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  4. #4
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    I am just trying to save a version that I can upload but it is taking time as the file is big!

  5. #5
    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,869

    Re: Find sum relating to a cell

    Save one that is small, please - we only need a few rows of data that show the problem.

    Have you been deleting or inserting rows at all? Or resorting the data? Formulae do not spontaneously change themselves!
    Last edited by AliGW; 06-03-2023 at 07:33 AM.

  6. #6
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    attachment added
    Attached Files Attached Files

  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,869

    Re: Find sum relating to a cell

    OK. So answers, then, please:

    1. Have you at any point reordered the rows oin the table (using sort in the table)?
    2. Why have you set the filter on the top row instead of the header row?
    3. Have you inserted or deleted any rows?

  8. #8
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    1. Have you at any point reordered the rows oin the table (using sort in the table)? - No
    2. Why have you set the filter on the top row instead of the header row? - I haven't on the real data its on the header
    3. Have you inserted or deleted any rows? no, only ever add data to the bottom each day

  9. #9
    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,869

    Re: Find sum relating to a cell

    I'm afraid I don't know, then. There's no test that I can do to check the data's behaviour.

  10. #10
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    there is the green error message showing top corner.

    Is there not something I can do to say highlight cells that use row 8942 in the sum?

  11. #11
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: Find sum relating to a cell

    Maybe, you can use this

    =COUNTIF(INDEX(A:A,2):INDEX(A:A,ROW()),INDEX(A:A,ROW()))

  12. #12
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    Thanks but that did not work so I will continue the painful task of checking 1 by 1!!

  13. #13
    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,869

    Re: Find sum relating to a cell

    Is it a range in your real data or a structured table?

  14. #14
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: Find sum relating to a cell

    Using conditional format to find error

    =TEXTBEFORE(TEXTAFTER(FORMULATEXT(B3),":"),",")<>TEXTBEFORE(TEXTAFTER(FORMULATEXT(B3),","),")")

    applied to $B$3:$B$100
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    the real data set is in a structured table

  16. #16
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    thanks I tried that and it just returned True for every cell

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

    Re: Find sum relating to a cell

    This might help speed things up a bit:
    1. Populate column C using: =FORMULATEXT(B2)
    2. Populate column C using: =VALUE(MID(C2,15,SEARCH(",",C2)-SEARCH("/",SUBSTITUTE(C2,"A","/",2))-1))
    3. Apply conditional formatting to column D using: =D2<>SUM(D1,1)
    This highlights three cells in the sample, however it reduces the number of cells needing inspection by 70%.
    That said, an easy correction, once any discrepancies are seen, would be to double click the fill handle of cell B2.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  18. #18
    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,869

    Re: Find sum relating to a cell

    Quote Originally Posted by rikknikk View Post
    the real data set is in a structured table
    OK - please try using a structured formula. Remove ALL of the formulae in the column in question and add a structured formula like this in the equivalent of B2:

    =COUNTIF(A$2:[@[Store ID]],[@[Store ID]])

    It will spill down the table.
    Attached Files Attached Files

  19. #19
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: Find sum relating to a cell

    I would recommend using the normal formula with anchor on header row: =COUNTIF(A$1:A2,A2).

    This formula should stay even if you should delete the first row or any other rows and will also not face any issue with sorting.

    With Excel structured table, the formula will also auto-expand to include any new items added at the bottom of the table or in-between existing rows.
    Last edited by josephteh; 06-04-2023 at 05:52 AM.

  20. #20
    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,869

    Re: Find sum relating to a cell

    In a structured table, that would need to be this:

    =COUNTIF(A$1:[@[Store ID]],[@[Store ID]])

  21. #21
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: Find sum relating to a cell

    Ali, this is not foolproof, if first row is deleted, it will result in error.

  22. #22
    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,869

    Re: Find sum relating to a cell

    No - it doesn't error at all. I can delete the top row altogether and I can even just delete top row contents - the formula still works.

    All tested in the attached.
    Attached Files Attached Files

  23. #23
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: Find sum relating to a cell

    Sorry, didn't realise you have changed to A$1.

  24. #24
    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,869

    Re: Find sum relating to a cell

    Did you think I would just repeat the same thing again?

  25. #25
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    Thank you so much for all your help, this seem to have worked on the column where I count how many times I have been to the same call ID without any errors.

    I also have a 2nd column which tells me the last time I called on the call ID, so Ive tried to change my sum to the same but its not accepting

    =COUNTIF(C$3:[@[Unique Call ID]],[@[Unique Call ID]]),"latest","")

    can you see where I have gone wrong on the final part of this sum please?

  26. #26
    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,869

    Re: Find sum relating to a cell

    Please provide a sample workbook for us to look at.

    What is the new formula meant to be doing?
    Last edited by AliGW; 06-05-2023 at 08:07 AM.

  27. #27
    Registered User
    Join Date
    07-21-2022
    Location
    Murcia, Spain
    MS-Off Ver
    Microsoft 365 apps for business
    Posts
    36

    Re: Find sum relating to a cell

    its the same set of data, ive added my current sum in to your test data.

    I am trying to return the word latest to the last time the call ID is used - ie if appears 3 times I want it on the 3rd one
    Attached Files Attached Files

  28. #28
    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,869

    Re: Find sum relating to a cell

    Try this:

    =IF(COUNTIF([Store ID],[@[Store ID]])=COUNTIF(A$1:[@[Store ID]],[@[Store ID]]),"Latest","")

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

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) 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 all those who offered help.
    Attached Files Attached Files
    Last edited by AliGW; 06-05-2023 at 08:25 AM. Reason: Workbook added.

  29. #29
    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,869

    Re: Find sum relating to a cell

    Thanks for the rep.

+ 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] Vlookup, index (not sure) find relating dates to a weeknumber
    By Mr_Excell_Ensie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2020, 09:14 AM
  2. Find cells relating to X and add together
    By Rimmers UK in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-04-2019, 05:29 PM
  3. [SOLVED] IF Function - relating adjacent cell check
    By rayted in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-17-2018, 11:26 AM
  4. Find/Match Text Name to Display Relating Values
    By btone in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-01-2015, 02:48 PM
  5. formula to take text relating to cell and carry into another cell
    By tswift01 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-16-2012, 03:28 PM
  6. Find a value in a database for the most recent date, return all values relating to it.
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-22-2012, 01:39 PM
  7. How do find Median of a set of totals and find the relating grade
    By whitespaces in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2006, 11:16 AM

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