+ Reply to Thread
Results 1 to 9 of 9

Dynamic modelling with the 24 hour time format

  1. #1
    Registered User
    Join Date
    06-05-2015
    Location
    Glasgow, Scotland
    MS-Off Ver
    2013
    Posts
    10

    Dynamic modelling with the 24 hour time format

    Hi guys,

    I have been struggling with a particular problem in Excel for a while, come here hoping someone in the forum might be able to offer a helping hand!

    I am creating a tool in Excel to model the charging of an Electric Vehicle. In the example picture attached; a Nissan Leaf battery is completely empty, and for the chosen charge point type, takes 10 hours to completely recharge at an assumed 80% batter efficiency (3 * 10 * 0.8 = 24). So there is a demand of "3" over a 10 hour period, with the start time specified by the scroll bar and the end time calculated as appropriate.

    I have found one simple way of modelling (almost) the result format I want - as shown in Columns E and F - but what I really want is highlighted in yellow with red text, a chronological time display with the charging demand alongside. But I am struggling to achieve this for specifically overnight charging e.g. from 9 p.m. - 6 a.m. as shown.

    I want to link this charging demand to a supply of renewable energy, but crucially I only have average values for 12 a.m. - 11 p.m. over one day. Therefore - whether I start charging at 5 a.m. and finish at 10 a.m. or start charging at 10 p.m. and finish at 5 a.m. - I want Excel to treat both 5 a.m.'s as the same day (i.e. not try and move on a day which seems to be the main cause of problem within IF limits I have tried to apply, as you can see the attempt of Column I fails).

    (I should say my initial plan was not to specify start and end times using the scroll bar at all, but to have a block equaling the demand of "3" in this case which could be moved up and down from 12 a.m. - 11 p.m. with its height (or number of rows) decided by the "Full charge (hours)" - I believe this may be possible but I cannot come close to teaching myself how to do it!)

    Excel Forum Post.png

    I hope what is written above gives a reasonable description of my problem, if not I will clarify further related to any specific questions. If anyone can provide any level of help on this matter whatsoever, I would really appreciate it.

    Thanks in advance,

    Calum

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Dynamic modelling with the 24 hour time format

    Welcome to the board.

    You're more likely to get useful assistance if you post workbooks rather than pictures.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-05-2015
    Location
    Glasgow, Scotland
    MS-Off Ver
    2013
    Posts
    10

    Re: Dynamic modelling with the 24 hour time format

    I have attached the workbook as shg suggested, thanks for the advice!

    The Tool.xlsx

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Dynamic modelling with the 24 hour time format

    Row\Col
    G
    H
    1
    Hour Ending
    2
    1:00 AM
    3
    3
    2:00 AM
    3
    4
    3:00 AM
    3
    5
    4:00 AM
    3
    6
    5:00 AM
    3
    7
    6:00 AM
    3
    8
    7:00 AM
    0
    9
    8:00 AM
    0
    10
    9:00 AM
    0
    11
    10:00 AM
    0
    12
    11:00 AM
    0
    13
    12:00 PM
    0
    14
    1:00 PM
    0
    15
    2:00 PM
    0
    16
    3:00 PM
    0
    17
    4:00 PM
    0
    18
    5:00 PM
    0
    19
    6:00 PM
    0
    20
    7:00 PM
    0
    21
    8:00 PM
    0
    22
    9:00 PM
    0
    23
    10:00 PM
    3
    24
    11:00 PM
    3
    25
    12:00 AM
    3
    26
    27


    In H2:

    =(($B$17 <= 1) * ((G2 > $B$16 + "0:0:1") * (G2 <= $B$17 + "0:0:1")) + ($B$17 > 1) * ((G2 <= $B$17 - "23:59:59") + (G2 >= $B$16 + "0:0:1"))) * $C$5

  5. #5
    Registered User
    Join Date
    06-05-2015
    Location
    Glasgow, Scotland
    MS-Off Ver
    2013
    Posts
    10

    Re: Dynamic modelling with the 24 hour time format

    That's brilliant shg, thanks for your help!

    You have no idea how much time that is going to save me.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Dynamic modelling with the 24 hour time format

    You're welcome.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Dynamic modelling with the 24 hour time format

    I think that the scroll is giving the wrong time range for a 10 hour charge. For example, if the start time is 9:00 PM there is 3 hours until midnight and then 7 more hours will make it 7:00 AM for the end of charge.
    I changed the formula in B17 to be
    =B16+TIME(B12,0,0)-1 This eliminates the "day factor" just leaving the hour value.
    I then used this formula to populate the column you want with 3 or 0. Seeing that 7:00 AM is the end of charge, it has a 0 and not a 3 as you are including the start time as having a 3. One or the other would have to be blank to have 10 filled cells.

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


    Darn: didn't see SOLVED
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Dynamic modelling with the 24 hour time format

    You might want to see the charging profile for the battery. It is interesting stuff. I did a Google search on "battery charger profile nissan leaf".

  9. #9
    Registered User
    Join Date
    06-05-2015
    Location
    Glasgow, Scotland
    MS-Off Ver
    2013
    Posts
    10

    Re: Dynamic modelling with the 24 hour time format

    doverman, shg's equation did require a slight change to:

    =(($B$17 <= 1) * ((G2 > $B$16 - "0:0:1") * (G2 <= $B$17 + "0:0:1")) + ($B$17 > 1) * ((G2 <= $B$17 - "23:59:59") + (G2 >= $B$16 - "0:0:1"))) * $C$5

    I think this was mostly my fault due to a slightly unclear description.

+ 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. modelling dynamic cycles
    By dhazi in forum Excel General
    Replies: 0
    Last Post: 04-23-2014, 09:04 PM
  2. Automatic 24 Hour time format
    By excellenthelp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2013, 01:15 PM
  3. 24 hour time format help with 00:00 calculation
    By pogo in forum Excel General
    Replies: 9
    Last Post: 07-22-2006, 08:15 AM
  4. dynamic modelling addin - excelsior?
    By tony h in forum Excel General
    Replies: 1
    Last Post: 02-14-2006, 12:54 PM
  5. [SOLVED] Convert decimal hour into time format?
    By ramdalen in forum Excel General
    Replies: 2
    Last Post: 06-20-2005, 02:05 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