Help creating a formula which returns current date last year

I need help creating a formula which returns the current date last year. I also need it to work during leap years.
Any ideas?

Hi Dagros,
I'm lucky to be a universe designer, I have to do this only once
The easiest way would probably be to use
=RelativeDate(CurrentDate();-365)
So subtractiing 365 to get the same date last year,
but you would need some extra logic for the years with a feb 29 in those 365 days.
=If FormatDate(RelativeDate(CurrentDate();-365);"dd") = FormatDate(CurrentDate();"dd")
Then RelativeDate(CurrentDate();-365)
Else RelativeDate(CurrentDate();-366)
Another question to ask is if you really want the same date last year, or if you also want a really 'same day' so monday compared to monday etc. in this case you would just subtract 364 days and get the day 52 weeks back...
Good luck,
Marianne

Similar Messages

  • I need help creating a formula that looksup cell data and give a value.

    I want to have the table "At a glance"  show the total days a driver has worked, there total in sales and there total in milage. The table shown is a example of what I want to have happen. I want to input any name into cell B2,C2,D2,ect. that is found in the row C2:C17 of Checkpoint (Truck 1) and Checkpoint (Truck 2) and return the total amount of day the driver has driven both trucks, The total in sales the driver has collected (Truck 1 and 2) and How many miles the driver has driven (Truck 1 and 2). I realize that these tables are not labeled correct. If I enter a name into B2 and the driver associated with that name hasnt driven then I want "N/A' to show in cell B2 and so one. I assume that the formula that is created for cell B2 will be copied and pasted into cell C2, D2, ect..
    If someone could help me with this problem I'd really appreciate it.
    Thanks.

    Hi br,
    To show the number of days worked by a driver, you need to COUNT the number of times that driver's name appears in row 2 of both tables.
    To calculate his total sales and total mileage, you need to SUM the amounts he brought in each day and the distances he drove each day.
    Your functions for this are COUNTIF and SUMIF.
    Formulas in At a Glance:
    B2: =COUNTIF(Truck 1 :: $3:$3,B$1)+COUNTIF(Truck 2 :: 3:3,B$1)
    B3: =SUMIF(Truck 1 :: $3:$3,B$1,Truck 1 :: $5:$5)+SUMIF(Truck 2 :: $3:$3,B$1,Truck 2 :: $5:$5)
    B4: =SUMIF(Truck 1 :: $3:$3,B$1,Truck 1 :: $12:$12)+SUMIF(Truck 2 :: $3:$3,B$1,Truck 2 :: $12:$12)
    Fill all three formulas right to the last column of At a Glance.
    To put N/A in place of the 0 in Roger's column and the empty columns, wrap each of the formulas in an IF statement:
    Bn: =IF(AND(ISERROR(MATCH(B$1,Truck 1 :: $3:$3,0)),ISERROR(MATCH(B$1,Truck 2 :: $3:$3,0))),"N/A",formula)
    Where formula is the formula used in column B above.
    Regards,
    Barry

  • Help creating a formula

    I could use help creating a formula.
    I have a excel file that I want to move to numbers.  In it, I track the date last put in a column.
    Each Column is for a date, and each row for an item.   When I put a date in a the column, I am trying to create a forula that woudl return the date last input.
    That is probably all confusing....but here is the excel formula that works, that does not work in numbers.
    =IF(B80>0, INDEX(G80:FH80,MATCH(9.99999999999999E+307,G80:FH80)), "Not Played")
    Or a second one I have also used
    =INDEX(C5:JZ5,MATCH(9.99999999999999E+307,C5:JZ5))
    Honestly - I don't understand the forumla, I got it from someone - I just know it works in Excell, but not in numbers.
    Below is a picture of what it comes out like in Excell.  The column that is not working is the "Last played"
    Does that make sense?  Any Numbers experts out there that can help me create a forumla in Numbers for this?

    Hi Jim,
    If I'm reading your table correctly, it appears that all dates a particular song has been played are listed in the same row as the song title.
    If that's the case, your formula in G3 would be:
    =MAX(H3:XX3)
    With the letter identification of the last column in the table replacing XX.
    The formula would then be filled down from G3 to the last row containing a song title.
    Two other suggestions:
    Numbers does not really perform well with large tables. The underlying model for a Numbers spreadsheet is a number of small, single purpose tables using no extra rows or columns.
    As a first order revision to this table, I would suggest splitting the table after column G, then adding a single header column before what was column H. The seven column table consisting of columns A to G would then becone a summary table. The only entered data in this table would be the labels "Worship song (Wed)" through to "Last Played" in row 1. Row 2 would be empty to match the position of the song titles on this table with the positions on the larger table, and both row 1 and row 2 would be set as Header Rows to permit their being frozen in place, allowing other roll to scroll behind these two.
    Everything else on that table, including the song titles, would be formula generated from data on the larger table.
    The larger table would become a data collection table, containing only one or two formulas—the formula in row 2 that counts the number of songs used on each day, and possibly one to generate the weekly dates in row 1. All other data on that table would be directly entered by typing from the keyboard, pasting after copying from an outside source, or by inserting usng a script or menu item.
    The main advantage here is that this arrangement would lessen th liklihood of accidently altering formulas during data entry by moving all data entry to a separate table, and by making it possible to lock the summary table, where no data entry takes place.
    A second suggestion would be to limit the number of columns in the Data table to one for the song titles plus enough to collect the data for a period of either one or two years.
    The main question to determine whether this would be a useful step is 'Do you have a use for the actual dates on which a song was played over two years ago, or is the number of times it was played in each year sufficient at that temporal distance?'
    Making this change would involve some additional annual maintenance, with a couple of hitches that I haven't yet looked at, so unless the ie=dea interests you, I'll let the second 'sleeping dog' lie.
    Regards,
    Barry

  • Table name in which return item data is stored of a PO

    Can some please specify the table name in which return item data is stored of a PO?
    Thanks in advance;

    Hi,
    Let me explain what exactly I need. In a PO there is a checkbox "Retun Item". If we check that checkbox for an item that item becomes a retun item.
    I need to fetch all the data of this return Item. The commitment data goes to table COOI but this return item records doesn't get stored in COOI table. I need all the data of this entry including the Network Activity, Project, WBS element etc.
    Please let me know if you could help me.
    Thanks.

  • How to create a table which contains relational data and Document data

    hai all
    i need to create a table which contains relational data(i mean coulumns whose data types are type NUMBER,VARCHAR) and documents(like xml file/html file/image)using iFS.
    when i store the document data(xml data/html data) in the iFS ,it will be stored as Document Object.so how do i relate this document object belongs to a particular row in a table.
    do guide me
    thanks

    Please see reply at http://technet.oracle.com:89/ubb/Forum36/HTML/000778.html

  • Formula to return the date of the fourth Thursday in a given month/year

    Using Excel 2013, I need a formula that returns the date of the fourth Thursday in a given month.  For example, if the date in
    A1 = 11/2/2012
    B1 needs a formula that references A1 and returns 11/22/2012
    or if
    A1 = 11/1/2014
    B1 needs a formula that references A1 and returns 11/27/2014.

    You can use this formula:
    =DATE(YEAR(A1),MONTH(A1),CHOOSE(WEEKDAY(DATE(YEAR(A1),MONTH(A1),1)),26,25,24,23,22,28,27))
    This formula has been derived from
    http://chandoo.org/wp/2009/11/25/findout-thanksgiving-date/
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Current date + 1 year

    Hi,
    Can anyone please tell me what is the easy method to calculate current date + 1 year?
    Is there any function module available?
    Thanks..
    Swetha.

    Beware of Leap Years.
    I Tried this and it works
    data date type sy-datum.
    data i_date type sy-datum value '20080229'.
    CALL FUNCTION 'ADD_TIME_TO_DATE'
      EXPORTING
        I_IDATE                     = i_date
        I_TIME                      = '1'
        I_IPRKZ                     = '3'
    *   I_RDMHD                     =
    IMPORTING
       O_IDATE                     = date
    * EXCEPTIONS
    *   INVALID_PERIOD              = 1
    *   INVALID_ROUND_UP_RULE       = 2
    *   INTERNAL_ERROR              = 3
    *   OTHERS                      = 4
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write date.
    i_iprkz = 3 means years and i_time is the increase

  • Show Current Date in Year Format (and now - 1, etc.)

    Our form has some column headers that need to change each year, the headings are current year (2010) + previous 3 years.  Am trying to programatically add the titles to eliminate modifying the form just to change the year, but not finding how to accomplish, and was checking out some date samples found, but no success yet.  My question is 2 part - how/where do I put code, I don't need the user to enter anything, just want a column header.  This example below is where I copied the idea from a sample and tried to adjust, it's on the calculate event of a date/time field, and I get an error message that says 'the display pattern "date-{MM/DD]" is incompatible with the object's data format.  Define a compatible Display pattern.  This display pattern error is the 2nd part of the question.  How do I display only the 4 digit year?
    year1.rawValue
    = num2date(date(), "YYYY")
    How do I accomplish this - am newbie on this!  Thank you very much!

A: Show Current Date in Year Format (and now - 1, etc.)

1) I typically use a hidden field to capture the current date on the layout:ready event.
2) If year1 is a date object  your script is valid but you are probably missing the display pattern date{YYYY} on year1.
If year1 is a text field you could could capture current year in a hidden field as
// form1.page1.currentYear::ready:layout - (FormCalc, client)
$.rawValue = Num2Date(Date(), "YYYY")
where currentYear has the display pattern date{YYYY} and add
this.rawValue = form1.page1.currentYear.rawValue;
to the calculate event of year1.
Steve

1) I typically use a hidden field to capture the current date on the layout:ready event.
2) If year1 is a date object  your script is valid but you are probably missing the display pattern date{YYYY} on year1.
If year1 is a text field you could could capture current year in a hidden field as
// form1.page1.currentYear::ready:layout - (FormCalc, client)
$.rawValue = Num2Date(Date(), "YYYY")
where currentYear has the display pattern date{YYYY} and add
this.rawValue = form1.page1.currentYear.rawValue;
to the calculate event of year1.
Steve

  • How to load member for "sales same date last year"?

    I need to load a member in Measures named "PriorYrSales" with "Sales" for the same date last year as today's date. Thus, retrieving "PriorYrSales" for 2/10/2002 would return the sales amount for 2/10/2001. Since days roll-up to months, quarters, years, it would be easy to determine how we're doing compared to the same time last year.Data is loaded each day for a date range from the current date and the preceding x days. Substitution variables are available for the beginning and ending date and the same dates for last year.For example: Data is loaded from beginning date of 2/01/2002 through ending date of 2/10/2002.The prior year date variables contain 2/01/2001 and 2/10/2001.The time period dimension is as follows:FY01->Jan2001-->01012001 (Alias: 1/01/2001)-->01022001 (Alias: 1/02/2001)-->all the dates in Jan->Feb2001-->02012001 (Alias: 2/01/2001)-->02022001 (Alias: 2/02/2001)-->all the dates in Febetc.FY02->Jan2002-->01012002 (Alias: 1/01/2002)-->01022002 (Alias: 1/02/2002)-->all the dates in Jan->Feb2002-->02012002 (Alias: 2/01/2002) -->02022002 (Alias: 2/01/2002)-->all the dates in Febetc.Thanks your any and all suggestions.Phil

    Perhaps I wasn't clear in the first post. The intent is to easily compare sales for a current date/period to the same date/period last year. Neither Excel nor Analyzer provide a method that I'm aware of to retrieve data as follows:-------------------------------------Period Sales PriorYrSales Diff4/15/2002 1,000 900 100-------------------------------------(900 is sales for 4/15/2001)(100 is the calculated difference.)Nor can I do this:-------------------------------------Period Sales Period Sales Diff4/15/2002 1,000 4/15/2001 900 100-------------------------------------What Excel and Analyzer do allow is:-------------------------------------Period Sales 4/15/2002 1,0004/15/2001 900-------------------------------------I readily acknowledge that the data is redundant but I can't think of another option that will allow Excel and Analyzer to easily retrieve the values for comparison. If the PriorYrSales member can be loaded then the users can compare years, quarters, months and days quite easily.My challenge is knowing how use a calc script to derive prior year dates that correspond to current year dates. Something like:PriorYrSales->04152002 = Sales->04152001I've considered arrays but I've never used them and the documentation is not helpful enough for me.Thanks for your response.Phil

  • HT4528 Good afternoon ...  I would like to know how I can do to communicate with Verizone company to see if I can unlock my iPhone 5 which acquired in NY last year, buy it because you sold me released but is totally false ...  I welcome your comments ...

    Good afternoon ...  I would like to know how I can do to communicate with Verizone company to see if I can unlock my iPhone 5 which acquired in NY last year, buy it because you sold me released but is totally false ...  I welcome your comments ...

    Krawly11 wrote:
    That's what they told me at the time of purchase and that's why the team acquired ...
    But when I get to Venezuela and introduce NANO-Sim in a line to use the phone here just does not respond to the network ... None of the 3 phone lines we handle here ...
    It is a 64G IPhone 5 ... 
    Regardless, it is not a matter of carrier locking.  Verizon iPhone 5 phones were never GSM sim-locked to begin with.  Every iPhone Verizon has sold since the introduction of the iPhone 5 has been sold with an unlocked GSM slot, as required in the USA by their agreement with the FCC.  They have not been allowed to sell any iPhone 5, iPhone 5c nor iPhone 5s devices with GSM carrier locking in place.
    Your connection problems are from some other cause - it is NOT a carrier locking issue.

  • How to create a formula that shows only the last date of a series of dates

    I have a report that shows a series of dates that 'notes' were created on a particular file. I want the report to only show the date of the last note that was created instead of showing all the dates. Ive tried using 'Maximum ()' which does not work.
    Any suggestions?

    Either order the dates in ascending order and place the date field in the group footer
    -or-
    order the dates on descending order and plade the date field in the group header.
    HTH,
    Jason

  • Ajax call method which return json Data

    Hi, I make one function , which i want to return json value , for this which return type i mention in function:
    This is javascript which call Retrieve method.
    <script>
    debugger;
             var remoteDatasource = new kendo.data.DataSource({
                 transport: {
                     read: {
      type:"POST",
      url: "Controllers/Home.cfc",
      dataType: "json",
                         data: {
      method: "Retrieve",
                             dataLists: JSON.stringify(request)
    </script>
    Home.cfc
    component
    remote   function Retrieve(string dataLists)
      try
                q = new Query();
                q.setsql("SELECT * FROM Product");
                qResult = q.execute().getresult();
                col_len = ListLen(qResult.Columnlist);
                dataArray = ArrayNew(1);
                row = 0;
                col = 0;
                for(row = 1; row <= len; row++)
                     for(col = 1; col <= col_len; col++)
                          FieldName = ListGetAt(qResult.Columnlist, col);
                          dataArray[row][col] = qResult[FieldName][col];
          jsonvar=serializeJSON(dataArray);
      catch(any e)
    return jsonvar;

    One can see immediately that you have to make the following corrections, at least:
    Give the query a name;
    Point the query to a datasource;
    Define the variable 'len' (even better, use a different, less confusing, name for the variable).

  • Current date month year in flex

    can anyone let me know how to get current system date in flex
    and how to compare seleted date and system date in flex
    thanks in advance

    below is the example code which get the date, month and year
    when you try to access the month it return less than one (if you try to get the month when the month is set to jan it return zero ) while displaying we need to increment as months starts from one
    import mx.controls.Alert;
    public function init():void
    var dt:Date= new Date();
    Alert.show("date : "+dt.getDate().toString()+"\nmonth : "+Number(Number(dt.getMonth().toString())+1) +"\nYear : "+dt.getFullYear().toString());
    if this post answers your question or helps, please mark it as such

  • Current date - 1 year in OBIEE

    Hi Friends,
    I have a  SR date column in OBIEE. Every day service requests will be submitted.  I want to put a filter on the report  every time when someone opens the report. I should always pull SR dates  between current date and  last year current date...In short, I want to see all the SR's from curret date to last year....
    Thanks
    V

    Put filter on open date as greater than or equals to timestampadd(sql_tsi_year,-1, curent_date)
    btw: what news on this?
    https://forums.oracle.com/thread/2572036
    if helps mark

  • Current date - 2 years

    Hi
    I need to get one of the report header column  like  current year - 2 based on the current date.
    For suppose format is like below
    2010 03
    if todays date is  10/03/2012
    I need to display  2010 03
    There is no source for  date column .
    I am using xir4 and Bex Query is the source.
    Can any body help me/
    Thanks.

    Hi,
    Try with relativedate function.
    like =relativedate((currentdate);-2) by this you will get two year back date.
    =formatdate(relativedate((currentdate);-2);"YYYYmm")
    or first get year then month by relative date function and use  concatenation.
    =formatdate(relativedate((currentdate);-2);"YYYY")
    =formatdate(relativedate((currentdate);-2);"mm")
    Thanks,
    Amit

  • Maybe you are looking for

    • BASIC Help With Windows 8.1 tablet

      I just bought the HP Stream 7 tablet. I'm an experienced computer user (since the early '80s). My desktop runs Windows 7. I have used an Android tablet for more than a year. This tablet is my first experience with Windows 8. I installed the Classic S

    • IPad programming - listing class/object variables

      Hey there, Im stuck with a little thing, I think i'm confused with value or object coding, anyways heres the deal: I've made and declared an object which consists of some information (ID, name, etc) and I want to parse XML results into this object. T

    • Command object locks table (TX)

      Im having locking probmlems with ODP.NET. Im updating same table with many connections in many threads. I get table locks for hours (over 24 hours) and I cant find any timout to set. The CommandTimeout on the Command object is not implemented. In the

    • IPod Touch and the battery

      This has to do with the comparison between the iPhone and the iPod Touch. I know all the features are the same, but what about the battery?! Does the iPod Touch have a battery that is not rechargable like the iPhone? Because I heard that is the main

    • Anything bought in the store won't play

      Everything I have bought in the store won't play on my iPod. This includes 13 movies, 1 music video and 2 songs. Everything worked until I took it to a friends house and plugged it in there. Any ideas why the purchases won't play?