+ Reply to Thread
Results 1 to 10 of 10

Daily Battery Cycle Formulas Give Circular Reference Errors

  1. #1
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Daily Battery Cycle Formulas Give Circular Reference Errors

    I'm creating a list to estimate energy utilisation for a given battery size on a daily cycle of charging from solar cells. I'm looking for tips to create this without causing circular reference errors.

    I have a list with 24 hrs for one typical weekday and one typical weekend per month. Available energy/drain is given in column G. The idea is that given energy or load, the battery will charge or drain, and I can track expected usage in column K. That way I can find the minimum size needed for a give load/charge profile.

    The problem is that if the the stored charge at 1am is dependent on what the charge is at midnight. To reflect this I used an If statement to skip down 24 cells if the time is zero. IE for H2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I also added a statement to force the stored energy to 0 at 5am so that I get a fresh start each day before the sun comes up.

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


    but this means that I'm making a circular set of formulas for each day. My if statements should prevent any errors, but I still have the circular reference issue. I would also rather not have to turn on iterative calculations.

    Does anyone have a suggestion of how to accomplish this?

    Many thanks.
    Attached Files Attached Files

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

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    IF statements wont prevent circ refs. I will take a look and see if I can come up with anything.
    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

  3. #3
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    Quote Originally Posted by FDibbins View Post
    IF statements wont prevent circ refs. I will take a look and see if I can come up with anything.
    Yes I realised that too. The if statement keeps my values sensible, but doesn't prevent the circular reference loop.

    I could manually break the loop by setting 5 or 6am values for Storage to a non-formula constant, but that will be annoying if I have to change the rules or build a longer list.

    If you are able to come up with anything that isn't a manual adjustment, that would be great thanks.
    Last edited by truk2; 05-19-2019 at 02:54 AM.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,959

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    When I open the file and enable editing, I don't get a message about circular references as I expected from reading the narrative in post #1. Therefore I am guessing that you are able to tell there is a problem by looking at the numbers. Please indicate which numbers are incorrect and what the correct values should be.
    It may be important for us to understand is why the stored charge at 1am is dependent on what the charge is at [the next] midnight [as opposed to the previous]. I am again guessing that to be the case as the IF formula skips "down" 23 rows [formula in H3 references I26].
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    Quote Originally Posted by JeteMc View Post
    It may be important for us to understand is why the stored charge at 1am is dependent on what the charge is at [the next] midnight [as opposed to the previous]. I am again guessing that to be the case as the IF formula skips "down" 23 rows [formula in H3 references I26].
    Let us know if you have any questions.
    To explain the formula, rows 3:26 represent a typical weekend (Is Week Day = 0) in January (month = 1). Rows 27:50 are the typical weekday in Jan. As I’m running a typical day set for each month (week vs week end) I only need to have 24 sets in about 600 rows instead of running a much longer list of 24hr x 365days requiring 8800 rows (I have a lot of other work to do with this data, and this saves a lot of calculation time).

    As such each day is an independent set, typical for that month, and the charge stored at 1am is dependant on the charge generated in the SAME typical day. For that reason the reference for stored charge at 1 am is 23 rows down where midnight for the current set is, NOT in the previous day.

    Quote Originally Posted by JeteMc View Post
    When I open the file and enable editing, I don't get a message about circular references as I expected from reading the narrative in post #1. Therefore I am guessing that you are able to tell there is a problem by looking at the numbers.
    Let us know if you have any questions.
    I don't have any problems with numbers I'm getting here, which do make sense to. I was purely concerned about getting the circ ref error. I didn't want to pass my sheet on colleagues to use if it was giving out errors.

    Oddly, I now don't get a circular reference error on the example file either. I did when I posted it.
    The columns the example file I provided are an exact copy of the set up I had in a MUCH larger file that still does give me circular ref error on those same formulas. But now the circular ref error disappears on sections of the worksheet If I click into the formula bar on on those cells. I'm a bit confused, but my problem seems to be evaporating (I don't like evaporative problems, they leave me worried that they will come back)

  6. #6
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    Follow up.
    The problem did come back. I still get a 'circular reference' error each time I open the file. That said, the formulas do give correct results.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,959

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    If you select cell H3 and utilize the trace precedents feature (Formulas tab) one of the arrows originates with cell I26. If you select trace precedents again one of the arrows for I26 originates with H26. If you continue to select trace precedents long enough then eventually H3 becomes the origin of an arrow. Similar results can be obtained by selecting cell H3 and repeatedly selecting trace dependents.
    So there appears to be no doubt that a circular reference occurs and, according to post #5, is purposeful.

  8. #8
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    Quote Originally Posted by JeteMc View Post
    So there appears to be no doubt that a circular reference occurs and, according to post #5, is purposeful.
    Yes. I knew that this was a circular reference when I built it. The point of the post is looking for better method that will allow me to calculate the charge stored with out using such a a circle. but keeping a similar row format.

    I'm happy to insert any number of helper columns, but still haven't thought of a way around this method.

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    Please Login or Register  to view this content.
    H3: =STORED(C3)
    Ben Van Johnson

  10. #10
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Daily Battery Cycle Formulas Give Circular Reference Errors

    Thanks protonLeah,

    Of course. Just set the formulas in VBA, and then I still have formulas, and the formula recorded in each cell doesn't have to cover all cases (in a circle). Simple. I should have thought of that. I guess once I got focused on the formulas, forget the easy way.

    Marking as solved

+ 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] Added front end and now formulas give errors instead of the desired N/A
    By billfinnjr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-13-2018, 11:21 AM
  2. Replies: 2
    Last Post: 02-23-2014, 06:06 PM
  3. Replies: 10
    Last Post: 06-01-2011, 02:45 AM
  4. Circular Reference Errors
    By aeddipa in forum Excel General
    Replies: 1
    Last Post: 06-30-2009, 04:08 PM
  5. Circular Reference when formulas reference end of row formula!
    By Spellbound in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-29-2009, 08:26 AM
  6. Circular reference formulas
    By bazza jay in forum Excel General
    Replies: 5
    Last Post: 08-12-2008, 08:58 AM
  7. Formulas that return blank cell give #VALUE errors
    By fdservices in forum Excel General
    Replies: 1
    Last Post: 06-09-2008, 11:07 AM

Tags for this Thread

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