Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    calculate day back... (2000 sr -1)

    assuming i have a cell B3 with a number 212 i want to calculate 212 days back respect today and store the date (DD/MM/YYYY) in cell F4, if is possible not considere holday in this count (without saturday and Sunday)....

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: calculate day back... (2000 sr -1)

    1) Select Tools | Add-Ins... (Strumenti | Componenti aggiuntivi...)
    Make sure that 'Analysis ToolPak' is installed, in other words that the check box for 'Analysis ToolPak' has been turned on.
    Then click OK.

    2) Use the following formula:

    =WORKDAY(TODAY(),-212)

    or

    =GIORNO.LAVORATIVO(OGGI();-212)

    3) Format the cell with the formula as a date, if necessary.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: calculate day back... (2000 sr -1)

    ok, but with function?
    Remeber i like function, now;-)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: calculate day back... (2000 sr -1)

    Why do all the work that Microsoft has already done all over again?

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: calculate day back... (2000 sr -1)

    in effect i use the famous DATA=sheets("folgio1").range("B" & RIGA)...
    var DATA is the new value of date calculation

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: calculate day back... (2000 sr -1)

    Here is a variation on my first reply

    1) Select Tools | Add-Ins... (Strumenti | Componenti aggiuntivi...)
    Make sure that 'Analysis ToolPak - VBA' is installed, in other words that the check box for 'Analysis ToolPak - VBA' has been turned on.
    Then click OK.

    2) Activate the Visual Basic Editor.
    Select Tools | References...
    Make sure that the check box for atpvbaen.xls is turned on.
    Then click OK.

    You now have lots of new VBA functions available, among which the Workday function. You can use this in the form

    new_date = Workday(start_date, difference)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •