+ Reply to Thread
Results 1 to 18 of 18

Stop calculating after a certain date

Hybrid View

  1. #1
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Stop calculating after a certain date

    Hi,
    I am trying to put together a plant register that calculates the costs from on hire and off hire dates. I am using IF function, which does calculate the cost between the two dates and stops accumulating in the to date total cost, however I also have a weekly cost which I want to return a result of 0 if there is an off hire result and this exceeds Todays date so it does not accumulate in the weekly total. I cant delete this line as then the to date total cost will be in correct.

    As I send out the plant register every Friday I want this cost included up to the friday of the week off hired. Once this has been exceeded then I want this to return a 0 result to it does not contribute to the weekly cost.

    Therefor I am looking for this formulae;-
    If start date is more than todays date then return 0. If off hire date is entered then include cost until the Friday of the off hire week. Once Friday of that week has passed then put 0 to stop counting.

    I have a formula which automatically calculates the next Friday, but this changes as its based on todays date, where as I want it fixed from the off hire date =TODAY()-CHOOSE(WEEKDAY(TODAY()),2,3,4,5,6,7,1)

    Any help would be great :-)

    Thanks
    Last edited by lara5555; 12-22-2011 at 01:58 PM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Stop calculating after a certain date

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

  3. #3
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Hi,

    Please see attached, I have put in different senarios that would occure, eg;-
    1) Start date is 09-12-11, so calculation has not yet started
    2) Off hire date is today, so cost to date has stopped calculating, however the weekly total is returning a value which is ok up until this Friday 08-12-11.
    3) Off hire date was 02-12-11, however the weekly rate is still being counted in the weekly plant total which is what I am trying to stop.
    4) Transport charges (adds first transport charge to cost to date, when start date is more than or equal to today, and then adds to return transport charge when off hire date is inserted).

    Many thanks
    Attached Files Attached Files

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    Hi Lara,

    I give you a solution, using IF(OR) & weeknum functions and a helper column.

    Hope to helps you.

    Regards
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Hi Fortis,

    Many thanks for your spreadsheet, I have changed some of the formulaes as it returned a 0 in the total to date cost which I wanted to keep hence not deleting the line, however it now works so thats great - thank you so much :-)

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    You are welcome.

    pLS MARK THE THREAD AS solved.

  7. #7
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    How do I mark it as solved?

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    Hi Lara

    To mark your thread solved do the following: - Go to the first post - Click edit - Click Advance - Just below the word "Title:" you will see a dropdown with the word No prefix. - Change to Solve - Click

    Also

    If any member's response has helped to solve your problem, please click the star icon below of their post to show your appreciation

  9. #9
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Ok Many thanks, will bear this in mind for the future.

    However I have a slight problem with the formula now that we are going into the new year.

    Because I cant delete any lines even if they have been off hired as they contribute to the total cost to date, and I want the weekly cost to calculate up until the Friday of the off hire week, but then return a 0 value so it does not continue calculating in the weekly total thereafter, the formula is linked to the week number. However when we get in to the new year the week number resets its self, so anything off hired in week 40 then resets itself as its done to calculate until it is greater than, it starts to cost in the weekly total again.

    Hopefully this makes sense.

    Any help would be great.

    Many thanks
    Attached Files Attached Files

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    Hi again.

    Maybe, it will not be necessary to modified the formulas.

    Pls take a look to the attachment and tell me if the result in ROW 16, IS CORECT.

    If no, pls tell me which is the corect result??
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Hi Fortis,

    Row 16 is correct, however if you change it so that it was hired and off hired last year, eg hired 01-10-11, and off hired 31-10-11 then the formula doesnt work as it starts calculating in the weekly total column again.

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    So here we are...again... (My name is Fotis. IS it so difficult??)

    First of all, for making your tests, you have to change the date in F3. To be not TODAY(), as your attachment, but let's say>>20/12/11 for testing this year and ...>>31/01/12, for testing next year..

    As you can understand it's not easy for me to describe this but pls take a look to the attachment.

    I think that adding two more(helper)columns and modifying the formula in Weekly TTL, column, the result is ok.

    Hope to helps you.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Sorry about the incorrect spelling Fotis !

    I cant seem to open the worksheet. Are you able to reattach it?

    Thanks

  14. #14
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    Good morning Lara

    Sure..Here it is...
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Hi Fotis,

    Please see attached spreadsheet. I think this now works? I have changed the week number column to weekending so that it generates a friday date, and then the weekly total calculates only if todays date is equal to or less than the weekending date of the off hire date!

    Hopefully that make sense, I have attached spreadsheet anyway. Do you see any errors?

    Thanks
    Attached Files Attached Files

  16. #16
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    Very good iob Lara. Very good.

    I think this is it...!

    If this thread, wasn't yours, i would gιve you a *!!

    The only that i have to tell you(if you want to), change in the formulas the F3 cell, to TODAY(). Just to be more pretty...!
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    11-17-2003
    Posts
    31

    Re: Stop calculating after a certain date

    Thanks Fotis, I thought I had set it up that way, but must have forgotten when checking the formula worked. Thank you for all your help.

    Happy Christmas and New Year

  18. #18
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Stop calculating after a certain date

    Glad to helped you, Lara

    Happy Christmas and New Year, for you. too!!

+ 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