+ Reply to Thread
Results 1 to 7 of 7

Formula for inserting date of last trading day

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    42

    Formula for inserting date of last trading day

    I'm trying to come up with a formula that allows me to insert the date of the previous trading day. Because for several reasons I can't create a column array of manually entered holidays, I'm trying to find a formula that would produce this. I've tried this, but excel doesn't like it.

    =DATUM(JAHR(ARBEITSTAG(HEUTE();-1;{DATUM(Jahr(heute());01;01);DATUM(Jahr(HEUTE());12;25))})); MONAT(ARBEITSTAG(HEUTE();-1;{DATUM(Jahr(heute());01;01);DATUM(Jahr(HEUTE());12;25))})); TAG(ARBEITSTAG(HEUTE();-1);{DATUM(Jahr(heute());01;01);DATUM(Jahr(HEUTE());12;25))}))

    Any help would be awesome

  2. #2
    Registered User
    Join Date
    08-05-2014
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    42

    Re: Formula for inserting date of last trading day

    removed for double post

  3. #3
    Registered User
    Join Date
    08-05-2014
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    42

    Re: Formula for inserting date of last trading day

    Sorry the formula is in German

    Datum = Date
    Arbeitstag = Workday
    Heute = Today
    Jahr = Year.
    Monat = Month
    Tag = Day

    You can easily write to me in English, and any formulas I can convert into German.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,844

    Re: Formula for inserting date of last trading day

    If you are trying to build holidays in to the formula you can use a version like this

    =WORKDAY(TODAY(),-1,DATE(YEAR(TODAY()),{1,12},{1,25}))

    That would give the previous workday to today with 1st Jan and 25th December excluded. You can extend the excluded dates, e.g. to also exclude 5th August

    =WORKDAY(TODAY(),-1,DATE(YEAR(TODAY()),{1,12,8},{1,25,5}))
    Audere est facere

  5. #5
    Registered User
    Join Date
    08-05-2014
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    42

    Re: Formula for inserting date of last trading day

    excellent, thanks!

  6. #6
    Registered User
    Join Date
    08-05-2014
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    42

    Re: Formula for inserting date of last trading day

    just one question, besides formatting the cell, how can I get that to show the date in date format and not as a serial number?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula for inserting date of last trading day

    =TEXT(WORKDAY(TODAY(),-1,DATE(YEAR(TODAY()),{1,12,8},{1,25,5})),"dd mmm yyyy")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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. Determining variables in trading formula to maximise profit
    By s1206795 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-12-2014, 02:22 AM
  2. Need help building profit formula for trading backtest
    By MPH1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2013, 10:45 AM
  3. Inserting countifs formula using vba.....having problem with date
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2011, 05:54 PM
  4. inserting date into a formula
    By lesliecharlery in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-15-2011, 11:46 AM
  5. Replies: 6
    Last Post: 05-21-2010, 11:14 AM

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