+ Reply to Thread
Results 1 to 12 of 12

Is there a way to write a successful circular formula?

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Is there a way to write a successful circular formula?

    I'm trying to write a formula that is circular in nature. From a fundamental standpoint, I can see why it doesn't work however I'm hoping there is another way to approach this.

    I'm a police officer working in an investigative unit. My Detective Sergeant would like to track the number of hours spent on each investigation. I would like to create a formula in our spreadsheet that would allow us to add the new numbers and keep a cumulative total. So for instance.

    If I want to add 8 hours into cell C5 because I spent 8 hours on that case today. And perhaps in D5 I have the number of hours that I have already worked on this case prior to today, for illustration purposes let's say that number is 37. How do I write the formula so that the 8 hours I worked on the case today gets added to the 37 hours that I have already worked on this case giving me a new total of 45 and then have the ablitily to repalce the number in C5 tomorrow with the hours that I work tomorrow on that case.

    If I simply create formula in E5 such as =SUM(C5,D5). Then I get the right answer but then there is no update to the new number if I need to add more hours in tomorrow. D5 will still read 37 instead of the new total that is 45. If I try to do a formula in D5 which is simply =E5, I'm creating a circular formula and even if it worked, since I have a value of 8 in C5 it's going to indefinitely keep adding 8 to the new total that keeps getting updated in D5 but obviously that can't work.

    Is there any other way to attack this issue or create this sort of functionality.

  2. #2
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Is there a way to write a successful circular formula?

    You can set up your data similar to the attached.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Re: Is there a way to write a successful circular formula?

    Hello officer =)

    From your set up table, it seems that you can do a pivot table where it'll show you the month and the cases with respect to the hours you've worked.

    The only 'downfall' to this is that you have to 'refresh' after new data has been input.

  4. #4
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Is there a way to write a successful circular formula?

    Thanks for the replies, as it turns out I have to head out of the office now to log a few more hours on a new case. I'll have to try these ideas out when I get back.

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

    Re: Is there a way to write a successful circular formula?

    You can get it to work by cutting the iterations in the options but I prefer a simple VBA routine.
    Right click on the cell tab > "View Code" and enter this code
    Please Login or Register  to view this content.
    See attachment
    I am assuming a single cell (C5). If there's a range of cells which you want to include then
    Please Login or Register  to view this content.
    Questions?
    Attached Files Attached Files
    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

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Is there a way to write a successful circular formula?

    Or you could just keep a record of everything you do, in 1 column (or 2 - time and case?) and then in another column, keep a running total there. That way you would have a history of everything you did, you could add case "type" and get a feel for the type of cases you work on, and how long each type of case takes
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Is there a way to write a successful circular formula?

    I'm not overly proficient at excel, so I'm going to be a bit trying to work through these possible solutions. In the meantime just in case it makes it clearer I will give you a rough idea of what I have going on so far.

    So each row has the case number, the officer in charge of the case, victim name, suspect name, ages for both, *** for both ,status of the case etc. so ideally I want on the same row as each case to add a few columns so that officers could come in after working on a case, open up the spreadsheet and then just drop how many ours they worked into the appropriate cell and the next cell over would perform the function of adding the number of hours worked today to the existing total number of hours worked on the case so far.

  8. #8
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Is there a way to write a successful circular formula?

    ChemistB, this is exactly what I am looking for; now I just have to see if I can follow your instructions and get it to work in my spreadsheet.
    Last edited by litesnsirens; 03-21-2013 at 09:20 PM.

  9. #9
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Is there a way to write a successful circular formula?

    ChemistB, I was able to get this to work. Many thanks to all for your ideas.

  10. #10
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Is there a way to write a successful circular formula?

    Sorry to re-visit this but suppose I want to create another multi-cell script on the same page, is this possible?
    For instance the script supplied by ChemistB worked exactly as I wanted it to. I have it set up so that all the numbers that are entered into cells H:3 to H:500 are tallied into cells I:3 to I:500 respectively. So now if I want to do the same thing with cells J:3 to J:500 and have them tally into cells K:3 to K500 respectively, how do I do it? I've tried some different things none of them work.

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

    Re: Is there a way to write a successful circular formula?

    Please Login or Register  to view this content.
    Does that work for you?

  12. #12
    Registered User
    Join Date
    03-21-2013
    Location
    Newmarket, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Is there a way to write a successful circular formula?

    Of course it does... You always have the answers... Unbelievable!!!
    Thanks a million...

+ 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