I have a date column called duedate, i need to make a new column which is called originaldate.
originaldate column should have dates as - duedate column dates + 90 days.
So, i need to add 90 days to a date column.
Can you please hep me with the expression for adding 90 days to a date column.
The syntax for this is:
DATEADD(datepart, number, date)
So for you, it would be:
DATEADD("day", 90, duedate)
Related
I have an array of dates and values and want to calculate in a formula at what date a certain value will be reached or be bigger.
Example:
1/1/2022 10
1/10/2022 13
1/20/2022 16
1/30/2022 19
At what date will 50 be reached?
GS has formulas to forecast the value for a date, but I know the value - I need the date.
Any help appriciated.
A4 is the first date a4:a7 is the dates, b4:b7 is the values, 365 is how many days I want to plot out into the future and 50 value is the number you requested to find the date.
=vlookup(50,arrayformula({Growth(B4:B7, A4:A7-$A$4, sequence(365)-1),sequence(365)+$A$4-1}),2)
50 will be reached on 10th May 2022...
try TREND function:
=TREND(A1:A4; B1:B4; 50)
or FORECAST:
=FORECAST(50, A1:A4, B1:B4)
or GROWTH:
=GROWTH(A1:A4, B1:B4, 50)
or LOGEST, LINEST based on your specific project needs
So I'm currently setting up a sheet that records weekly numbers. I'd love to have something that summarizes the totals (money in, loss, etc) by month. So if the week = 4/4/0 this is April (4) and is calculated just by a drop-down of months. Is such a thing possible in Sheets? I don't need the formula just the clue, really.
Update:
I found something similar:
=SUMIFS($N$7:$N$11,$M$7:$M$11,">="&S8,$M$7:$M$11,"<="&EOMONTH(S8,0))
N7:N11 is amount
M7:M11 is date
S8 is the date I'm querying for
The issue I have with that (^^) formula is that it wants me to present the date as D-MONTH-YYYY
but I'd love the date to just be the MONTH
You can set the column to show just the month by setting its format:
and creating a "Custom date & time"
Alternatively, you can use text to represent the months and convert them to number representation using MONTH(S8&1)
Then, you can do some funky way of converting the "month" to "date" using DATE(YEAR, MONTH(S8&1), 1), where "year" is the year you're querying for.
To sum it up, the formula from your question might look something like this:
=SUMIFS($N$7:$N$11, $M$7:$M$11, ">="&DATE(2022, MONTH(S8&1), 1), $M$7:$M$11, "<="&EOMONTH(2022, MONTH(S8&1), 1),0))
I don't think this problem is solvable but I figured I would ask.
Data:
DateDim table with 1 row for every date. Columns = date
Sales table with 1 row for every sale. Important columns = id, sales_date
tables relate on date = sales_date
Plot:
I am plotting count of sales for each date, with date on the x-axis and count([id]) on the y-axis.
Problem:
I need a dynamic x-axis. If I filter date for less than a month I need days on the X-axis, but if I filter greater than a month I need month-year on the x-axis.
I accomplished this with daterunc function.
If endDate - startDate < 30
then daterunc('day', [date])
else if endDate - startDate >= 30
then daterunc('month', [date])
end
This works nice except for one issue: missing values. If I use the date as the axis, I can right click the date and select "show missing values" which will correctly plot 0 on days with no sales.
But the calculation above does not have a 'show missing values' option. So the plot does not show zeros when I use the calculation.
Is it possible to modify the above calculation to show missing values?
I want to use a single formula in cell A2 to insert Month to date Automatically. (in descending order). Only show date within this month (September)
For example, Today is 9/2/2021.
It will show:
9/2/2021
9/1/2021
Let's say we entering the next day 9/3/2021.
It will show:
9/3/2021
9/2/2021
9/1/2021
https://docs.google.com/spreadsheets/d/1Rq7_yGZjXEqN84BIKmmZ0a8qlcPF2ZIgvdCD2aorGKc/edit?usp=sharing
Thank you so much for your help.
Try this in A2 based on the date from B1:
=arrayformula(sort((eomonth(B1,-1))+(sequence(B1-eomonth(B1,-1),1)),1,0))
or this using today():
=arrayformula(sort((eomonth(today(),-1))+(sequence(today()-eomonth(today(),-1),1)),1,0))
I am trying to figure if the following can be done. If there are duplicate names in the B column then it will see if the date and time were within 24 hours of each other in the A column, if so it will highlight the cell yellow.
Currently, the formula I have will only highlight if it was on the same date. Is there a way I can add to the formula to all take into account time? So that if one response is on 5/20/20 at 17:00 and the next duplicate name is at 5/21/20 at 16:00 then the cell would be highlighted.
Here is the formula I am using the just highlights if it is within the same date:
=ARRAYFORMULA(COUNTIFS(B:B, B2, DATEVALUE(A:A), DATEVALUE(A2))>1)
I am not sure if something like this is possible. I am guessing that the formula would have to compare both datevalue and timevalue. Any help would be appreciated.
Instead of DATEVALUE you can use TO_PURE_NUMBER
This will return you the number of days from January 1, 1900 including the fraction for past hours and minutes opposed to DATEVALUE that rounds the value down to an integral day number.
Sample:
This allows you to calculate the real difference time between your timestamp.
For example like this:
=ARRAYFORMULA(or(COUNTIFS(B:B, B2, TO_PURE_NUMBER(A:A), ">"&TO_PURE_NUMBER(A2)-1, TO_PURE_NUMBER(A:A), "<"&TO_PURE_NUMBER(A2))>0,COUNTIFS(B:B, B2, TO_PURE_NUMBER(A:A), "<"&TO_PURE_NUMBER(A2)+1,TO_PURE_NUMBER(A:A), ">"&TO_PURE_NUMBER(A2))>0))