I have a spreadsheet which shows me the inventory of my stock.
Product name Qty Average orders/month Stock available until:
Product1 100 10 xx/xx/xxxx
I would like to calculate, using today date, the estimated date my stock will be at 0.
In this example I have 100 / 10 = 10 month from today.But how can I get the date difference? ie convert 10 months from now into a date
Also I know how to change background color according to specific values of the cell, but how can I do the same for the amount of days between today and the estimated date?
Thanks for your help
=date(year(today()),month(today())+10,day(today())
The above formula we put you on the same calendar date that is 10 months after the current month. The number of days between today and that day 10 months from now will vary as the number of days in a month changes. You will also get some slightly unexpected results when you try to find the 30th day 10 months from April since February only has 28/29 days. it will actually tell you early march which is technically 11 months away.
Where you see 10 in the formula above, replace it with your equation that will calculate 10
Since you will be dealing with fractions of a month, you will need to determine a way that suits your needs to convert that into number of days. My personal recommendation is you treat every month as having 30 days. so 10.5 months is really 10.5*30=315 days. So the formula above would become:
=today()+315
or
=today()+10.5*30
So in this case replace either the 10.5 with your formula that calculates months or replaces 315 with your formula that converts fractions of a month into days. Note days will need to be an integer so consider rounding your results ROUND(results,0) or INT(results).
As for changing your cell colour based on conditional formatting, lets assume your end date is in the D column. Select the range in the D column making sure your active cell is D2 (by default this would be the cell with the white background and is the first cell clicked on to start the last selection drag). Go into your conditional formatting and select formula ando for your logicinal condition to return true you and have the colouring take effect you want to use a formula like:
=D2-today()<=21
That should evaluate true or false.
Related
I am trying to develop an Agile sprint spreadsheet that takes into account the effort spent on each task on each day.
At the top of the sheet i have two fields, Start date and Sprint Duration.
What i want to achieve is underneath this, display the dates, starting at the first date and extending horizontally to the right.
Is this possible to achieve?
Today 7/19/2018
Duration 14
Start 7/19/2018
End 8/2/2018
Task Estimated Effort Actual Effort 7/19/2018 7/20/2018 7/21/2018 7/22/2018
Data Migration 10 5 2 3
Design 7 7 3 4
Groups 1 7
Where the dates displayed are displayed dynamically as outlined in the question above
Using Duration in B2 and Start Date in B3 you could use these two formula:
The first date in cell D6 (7/19/2018) is the Start Date and will always be visible, so a simple formula can grab that:
=$B$3
The rest of the dates needs to check if the previous date is less than the Start Date plus Duration days. If it is then put the previous date plus 1 day, if not then leave the cell blank. The formula is placed in cell E6 and dragged across as far as you need.
=IF(D$6<SUM($B$2:$B$3),D$6+1,"")
I have daily data from 01-Jan-2005 till 29-Dec-2017. I want for each year to select the last day of March, June, September, and December, alongside their respective data. Part of the data:
Date Variable
30-Mar-2005 1.2943
31-Mar-2005 1.2964
1-Apr-2005 1.2959
4-Apr-2005 1.2883
5-Apr-2005 1.281
I.E: For 2005, I want the dates of 31-March-2005, 30-June-2005, 30-September-2005, and 30-Dec-2005. Desired output:
Date Variable
31-Mar-2005 1.2964
30-Jun-2005 1.9859
30-Sep-2005 1.2233
30-Dec-2005 1.2814
I currently have the build in excel formulas (i haven't installed any other plug-ins etc).
More specifically: on the left i have the data, and on the right the desired output.
Not sure if this is going to work to you, but anyways.
Looks like you always look at the last day of months March, June, September and December on a specific year (in example, 2005).
But you are not looking for the last natural day of each month. You want the last day of each month that appears in your data (in example, that explains why you use 30 december 2005 instead of 31, because there is no 31).
In Excel, dates are numbers. The more you go in the future, a bigger number is related. Knowing this, you can get the date for each month just looking the MAX value of a range of dates.
But first, you need to define the range of dates, using 2 conditions:
Month of date must be March, June, September and December
You want dates for a specific year (in example, 2005).
To get this, you need an array formula. My formula gets the max day of a specific month and year. To test it, in my Excel I did a dates series, starting in 01/01/2005 and done in 31/12/2017. I deleted manually 31/12/2005 because that date has no data.
In cell I4, just type the year you want to check. The formula will get he last day of months March, June, September and December of that year.
My array formula is:
=MAX(IF(MONTH(IF(YEAR($A$4:$A$4750)=$I$4;$A$4:$A$4750))=3;$A$4:$A$4750))
IMPORTANT!: Because it is an array formula, you will need to type it
as usual, and then, instead of pressing Enter press
CTRL+SHIFT+ENTER
You need 4 times this formula. Just change the 3 (March) for the number of the month you need (6,9 and 12).
Now that you have the dates, you just need a VlookUp to get the value you want.
=VLOOKUP(G5;$A$4:$B$4750;2;false)
If I change the year value, i get those new values:
If you want to check the file. I uploaded an example to Gdrive, so you can download if you want.Download
Anyways, try to adapt this formulas to your needs.
I converted a list of Euro conversions into a Table and used structured references. But you can use normal range references if you prefer.
In some other table, enter the following formula, where $A$45 refers to the first quarter ending date in your data table.
F2: =IF(EOMONTH($A$45,(ROWS($1:1)-1)*3)>MAX(Table1[Date]),"",LOOKUP(2,1/(EOMONTH($A$45,(ROWS($1:1)-1)*3)>=Table1[Date]),Table1[Date]))
In the adjacent column, enter the formula:
G2: =IFERROR(VLOOKUP(F3,Table1,2,FALSE),"")
And fill down until you get blanks.
(in my sample table, the last date is 1/27/2006 so the last included "End date" is 12/30/2005, there being no data for 12/31/2005)
So, there are two cases
When you have the exact last days of the month. (Its simpler).
I had a fortnightly data. I adopted this simple and innovative method. From all the dates, I first extracted the day using Day() function. for example, Day(A1). (Remember, while doing this, do not delete your original date column. Do it in a separate column as this would help you match the dates later).
Then I sorted the data using the Day column, just constructed before, in decreasing order. This would place all end dates at first. And then deleted the starting dates which were at bottom. So, now I am left with only end dates but obviously months are not in order.
So, create another column extracting just the month and year from the original date column using =MONTH(A1) & "/" & YEAR(A1). Sort the data using this column. And, you are good to go!
When you do not have the exact last days, but maximum dates like the one shown above in picture.
In this, while deleting the initial dates, you would have to take care of which date on-wards you need to delete.
For example, I deleted day 17 on-wards of months with 31 days (including day 17) and day 16 on-wards of months with 30 days (if present) because if there was this date, suppose, 18 April 2018, then this would be the last day of the month as I had a fortnightly data.
=IF(AND(DATE(YEAR(EE$2),MONTH(EE$2)+IF($B6<DAY(EE$2),1,0),DAY($B6))>=EE$2,DATE(YEAR(EE$2),MONTH(EE$2)+IF($B6<DAY(EE$2),1,0),DAY($B6))<EE$2+14),470,”")
Using Google Sheets to make a budget (See attached image snapshots). I’m a little bit stuck on a complex spreadsheet formula (listed above). What I’m trying to do is get a bill to populate with the amount, only if the particular payday falls exactly on or 6 days before the due date. Here’s what I’m working with:
Column Headers: I have set these cells so that they auto-populate with the payday, which happens every week on Friday.
Row 6 and 7 are where I want the amount to show up. I’ve been having to put them in manually, but I’d like to automate it for the length of the bill (60 months)
Column B, cells (B6 & B7) are set with a plain text number corresponding to the day of the month it’s due (i.e. 5th of each month for the Ford). So B6 cell has number 5 in it.
If the due date for the Ford Car Payment is the 5th of every month, I need the number $470 to populate into the cell if the date above the column is the 5th of the month or minus 6 days from it. Because the bill doesn’t always fall on a payday, as in the in EE or EF Column, it needs to populate with $470 on the EE6 cell to make sure the bill is paid on time.
Essentially, I want to be able to paste the formula into the 6th row, and have it only populate on the pay date closest 5th of each month, but not after the 5th. If it returns 0 like on cell ED6, the cell should remain blank.
Any ideas how I can make this possible?
=IF(ISNUMBER(MATCH($B5, ArrayFormula(DAY(C$3+{0,1,2,3,4,5,6})), 0)), 470, "")
Using C3 as the start assuming your calendar days start at C3.
The way this works is:
ArrayFormula(C$3+{1,2,3,4,5,6}) Generates a synthetic Range of dates starting at the date in C3 and the week following
ArrayFormula(DAY(C$3+{1,2,3,4,5,6})) just extracts the day's number of the month from all the dates. A date range from 2017-01-28 - 2017-02-03 would leave you with {28, 29, 30, 31, 01, 02, 03}
MATCH($B5, <2>, 0) Will try to find the Due month-day in the month-day list we just generated and return the position or an error if it is not there.
ISNUMBER(<3>) will be TRUE if the day is contained, otherwise false
IF(<4>, 470, "") Prints the payment on the correct dates, of course you can change 470 to a cell reference like $ZZ5.
You can drag this formula right and down
Click for diagram explanation
Hi guys,
I have managed to find out formula for counting week 1 from custom start date and not from start of the year. (see first diagram above) I've achieved this by entering date manually and having a formula in week cell.
"**Week #"** =TRUNC(((A2-A1)+6)/7)+(WEEKDAY(A2)=WEEKDAY(A1))
Now I want to do it the other way round, rather than type in date every time, I want to type in a week number, relating week number from custom start date that would then be translated into proper date.
10 weeks later would simply be taking your start date adding 7 times the number of weeks or in this case 70 days. Assuming your start date is in C2 and your number of weeks from C2 is in C4, then your formula would be as follows:
=(C2-1)+7*C4
As for your week number formula, you may want to consider changing it to:
=WEEKNUM(I3,2)-WEEKNUM(I2,2)+1
Where I2 is your start date and I3 is your second date. The 2 in the weeknum formula is to tell it your week starts on a Monday.
Based on your comment about different years you could try:
=(WEEKNUM(I3,2)+52*(year(I3)-Year(I2)))-WEEKNUM(I2,2)+1
I am trying to adapt a number of forum posts and previous stack questions like this.
Let's say I have a date Column A2, A3, A4 etc.
I want to be able to utilize the WEEKDAY function to evaluate my condition when only in a Weekday and also 3 days greater than the date in Cell A(x).
So far my attempts have failed or I have not got the results I want. Excel is not my strongest point when it comes to conditional formula formatting.
I think it may be something like:
=WEEKDAY(A$2,2) <=5 AND 'My Cell Date' > 3 Days WHERE those 3 days are weekdays.
Also if it is possible, I want it to work like:
If day 1 of 3 is Thursday, day 2 of 3 is Friday and day 3 of 3 is Monday then apply formatting.
Could anyone help me out with this one please?
Edit not from OP to copy clarification from comments:
If the today date is 3 working days greater than the cell date change to red.
Say A2 has a received date and B2 has a completed date. The completed date is my target. Is it 3 working days greater than received.
Was not quite certain of the requirement (but seem to have hit upon an acceptable solution!):
Use =NETWORKDAYS(A2,B2)>2 under Format values where this formula is true: under Use a formula to determine which cells to format in Conditional Formatting.
NETWORKDAYS
Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays.
The syntax is:
NETWORKDAYS(start_date,end_date,holidays)
Dates should be entered by using the DATE function, or as results of other formulas or functions.