Google Spreedsheet Maths Date function - date

ok so in column A i have todays date 18/06/2013 and i want to add 25 days to it, but because i have a list of 100 dates (all different) I need away to do the same thing that
=DATE(2013,06,18)+25
would do but if you look in open office you can do the same thing by running =A1+25 and that gives you the date in 25 days, in Google that does not work.

The TODAY function for Google Spreedsheets returns the current computer system date. The value is updated when your document recalculates. Look at Google spreadsheets function list.
Here is an example:
=TODAY()+25

Related

Using REST to filter Share Point date field

I need to filter the date in wish an item was received in a SharePoint list using REST. I have it partially working, but I have a problem. I'm using a Datepicker to select the date I'm using as filter, but when the date is picked and converted to an acceptable format using toISOString(), I get an "exact" date (e.g. 2018-06-15T00:00:00.000Z). The issue with that is that the Date portion (2018-06-15) matches OK, but not the Time portion, because the datepicker will always give a different time (HH:MM:SS) than the SharePoint list entry.
This is what I'm using:
... $filter=Date_Received eq datetime'2018-05-11T04:00:00.000Z'
I have several items that were entered on 6/15/2018, but I get no values, because the time they were entered was different (e.g. 2018-06-15T05:00:00Z). Is there a way to use something like substringof to filter dates, or does anyone has a workaround?
Thanks in advance.
Dates in SharePoint are stored in GMT. So the times recorded are London times.
Option 1 - Use ranges:
$filter=Date_Received gt datetime'2018-05-10T20:00:00.000Z' and Date_Received lt datetime'2018-05-11T20:00:00.000Z'
If you are not looking for files near midnight then:
$filter=Date_Received gt datetime'2018-05-11T00:00:00.000Z' and Date_Received lt datetime'2018-05-11T23:59:59.000Z'
Option 2 - Use the SharePoint 2010 REST API and date functions:
/sites/yourSite/_vti_bin/listdata.svc/yourList?$filter=year(Date_Received) eq 2018 and month(Date_Received) eq 5 and day(Date_Received) eq 11
This still has an issue for dates around midnight due to GMT.
Option 3 - Use SharePoint 2010 REST API with a calculated column:
Add a Calculated column named Date_Received_Text as: =TEXT(Date_Received,"yyyy-mm-dd")
/sites/yourSite/_vti_bin/listdata.svc/yourList?$filter=Date_Received_Text eq '2018-07-08'
Same midnight issue...
Note: The 2010 API still works in SharePoint Online.

How do I pull the week of the month from text strings in this Twilio format 2019-08-22 06:12:58 MDT?

I am using the Twilio log file to crunch some data and need to convert the Twilio format for dates into something that Google Sheets can recognize as a date so I can then extract what week of the month the date is referring to. Also would be helpful to get the syntax that converts the Twilio date to a recognizable date for Googlesheets in case there are other things I need to do with the date field.
Currently, this is the format in the log file: "2019-08-22 06:12:58 MDT"
I'm using this =text(index(split(I2," "),,1),"mmmm") to determine the month and am struggling to have this now be able to work with the WEEKNUM function of Googlesheets to get the number of the week the date is from. I've tried =DATE(index(split(I2," "),,1),"mmmm"), =WEEKNUM(index(split(I2," "),,1),"mmmm") but am terrible with the formula syntax and can't fix the date value.
=DATE(index(split(I2," "),,1),"mmmm")
I expect to see a value from 1-5.
The text() part of the formula is turning the date input into text. And so you can't use it to calculate the weeknum().
=weeknum(index(split(I2," "),,1)) will get you closer. But it will give you the week of the year.
You may want to see this for a way to get to week of the month from week in the year.

VB Script for date extraction and formatting

I work on OCR. We extract text from invoices automatically. When the contents of the invoice are extracted they are stored in a text file, and then we write scripts to extract the data from the text file according to our requirements.
One requirement that has got me stuck is, I need to extract the date from a text file which is not written in any particular format. Its written as 12 08 2014 in a line. I need to extract this and print it out in the dd/mm/yyyy format.
Also, the dates can be written in any format, for example 2nd December 2013, 12-12-2013, 12 Aug 2013 and so on. I need to read the date and extract it in the form of dd/mm/yyyy.
A little heads up for the problem.
There is no fixed location for the date. There are about 14000 invoices, most have a separate location of the date and separate format. I get the images and the scanned text file of the invoices, and i have to locate the date and try to format it.
The date is not after any fixed keyword that i could use. Like i mentioned in the first point, it can be after the word invoice number, or cost or any other work. SO the idea of searching it using keywords does not work as well.
This is the most stupid one, suppose I get the date 1/2/2011, how do I know whats the day and whats the month? The client has just entered a date, i have no way of finding out whats the day and the month. Is it even possible to find this out?
ORDERED SHIPPED
01239751 28 08 14 03 09 14 E31192-00 1
CUST.NO. ItN1 R 0 R NO SALE MM
NOM CI WATT VOTRF NO nr CAMMANOF in-W.01M
ADDRESS HERE
Te1:(123)123-1234/ Fax:(123)795-1234
Facture / Invoice
OUTPS:R-103958989 CONE:MONS Taws> NET 60 DAYS
SOLD TO / VENDU A SHIPPED TO / EXPEDIE A
You've already asked this.
You don't know and there is no way to know. We normally base it on the locale of the computer how dates are read. Yanks do m/d/y while the rest of the world do d/m/y. In the US windows functions assume the first and in the rest of the world the second.
As to years. Two digits are interpreted according to control panel settings. 29 and below is 2000 to 2029. 30 and above is 1930 - 1999.
Computers can not read the minds of people who write dates.

EOM date for various months

I'm looking to get a snapshot of inventory for the latest date of each month.
I.E.
Feb 13
Jan 14
Feb 14
There are duplicate variables - i.e., "a" will be listed several times each month. I need to get a.) the sum of each month (easy), and b.) the snapshot of the last date available.
Part B.) is what I'm having trouble with. I've seen the EOM excel formula - but it requires entering (current, following month, etc.). I just want the formula to spit out the inventory Quantity for the last date of each month, without having to specify which month (current, following, etc.).
Any ideas?
Thanks!
I'm assuming that your data is structured something like this:
http://i.stack.imgur.com/mF3h0.png
If that is the case, you can use a formula like this:
=VLOOKUP(EOMONTH(A12,0),$A$2:$B$5,2,FALSE)
Where A12 is the month you want to find the answer for. So the full sheet looks like this:
http://i.stack.imgur.com/GR5ok.png
As you can see, the formula that I put into cell B12 and then just dragged down is pulling back the correct values for the end of month inventory count. Just populate column A with the month-year you are searching for.
Hope this helps!

Number of days between past date and current date in Google spreadsheet

I want to calculate the number of days passed between past date and a current date. My past date is in the format dd/mm/yyyy format. I have used below mentioned formulas but giving the proper output.
=DAYS360(A2,TODAY())
=MINUS(D2,TODAY())
In the above formula A2 = 4/12/2012 (dd/mm/yyyy) and I am not sure whether TODAY returns in dd/mm/yyyy format or not. I have tried using 123 button on the tool bar, but no luck.
The following seemed to work well for me:
=DATEDIF(B2, Today(), "D")
DAYS360 does not calculate what you want, i.e. the number of days passed between the two dates – see the end of this post for details.
MINUS() should work fine, just not how you tried but the other way round:
=MINUS(TODAY(),D2)
You may also use simple subtraction (-):
=TODAY()-D2
I made an updated copy of #DrCord’s sample spreadsheet to illustrate this.
Are you SURE you want DAYS360? That is a specialized function used in the
financial sector to simplify calculations for bonds. It assumes a 360 day
year, with 12 months of 30 days each. If you really want actual days, you'll
lose 6 days each year.
[source]
Since this is the top Google answer for this, and it was way easier than I expected, here is the simple answer. Just subtract date1 from date2.
If this is your spreadsheet dates
A B
1 10/11/2017 12/1/2017
=(B1)-(A1)
results in 51, which is the number of days between a past date and a current date in Google spreadsheet
As long as it is a date format Google Sheets recognizes, you can directly subtract them and it will be correct.
To do it for a current date, just use the =TODAY() function.
=TODAY()-A1
While today works great, you can't use a date directly in the formula, you should referencing a cell that contains a date.
=(12/1/2017)-(10/1/2017) results in 0.0009915716411, not 61.
I used your idea, and found the difference and then just divided by 365 days. Worked a treat.
=MINUS(F2,TODAY())/365
Then I shifted my cell properties to not display decimals.
If you are using the two formulas at the same time, it will not work...
Here is a simple spreadsheet with it working:
https://docs.google.com/spreadsheet/ccc?key=0AiOy0YDBXjt4dDJSQWg1Qlp6TEw5SzNqZENGOWgwbGc
If you are still getting problems I would need to know what type of erroneous result you are getting.
Today() returns a numeric integer value: Returns the current computer system date. The value is updated when your document recalculates. TODAY is a function without arguments.
The following worked for me. Kindly note that TODAY() must NOT be the first argument in the function otherwise it will not work.
=DATEDIF( W2, TODAY(), "d")
Today() does return value in DATE format.
Select your "Days left field" and paste this formula in the field
=DAYS360(today(),C2)
Go to Format > Number > More formats >Custom number format and select the number with no decimal numbers.
I tested, it works, at least in new version of Sheets, March 2015.