I'm trying to create a column in a table that calculates a date of 30 days + or - 14 days. How do I create a formula with an allowed window of deviation?
So far all my equations are on dates without windows for example "=A1 +7".
Related
I need an Excel formula to calculate percentage of unit price for 12 months started from launch month. In column A there are different launch dates of each product. Column B has unit prices. A row has percentages for each month for a period of 24 months in proper date format like column c3 contains date 31/01/2023 then in next column 28/02/2023 and so on for 24 months. Each of the 24 months has separate percentage mentioned above it.
1- Formula should only calculate values for 12 months started immediately from the month of launch i.e. if launch date is 15/02/2023 then it should calculate % till 31/01/2024. and all other months should be retuned as 0. I have tried if with and for arguments using month and year. But it is not total success.
Formula is =IF(AND(MONTH($A4)>=MONTH(C$3),YEAR($A4)=YEAR(C$3)),PRODUCT($B4,C$2),0)
I have an excel document with values for every hour for every day of a year.
In total there are 365*24=8760 values.
I would like to get the average value at every hour, (etc at 00:00, 01:00, 02:00..)
I was thinking maybe to sum every 24th value and then divide it by 365 but I don't know how to sum every 24th value.
Does anyone know how to do that?
Thanks for any help!
The clearer way of doing it is using a column to get the hour of each data point and adding a AVERAGEIF formula to calculate the average of every hour.
I am assuming your date/time is on A2:A8761 and the values on B2:B8761.
On C2, add the formula =HOUR(A2) and drag it down to find the hour of every data observation (for newer excel versions you can also
do =HOUR(A2:A8761) and the formula will automatically spill down). The results are numbers from 0 to 23.
Building the summary table:
Add a column listing the numbers 0 to 23 to represent the 24 hours. I did it on column E2:E25. Note that those are numbers, not date/time.
On F2, add the formula =AVERAGEIF($C$2:$C$8761,E2,$B$2:$B$8761) to calculate the average of the hours listed on column E. Then, drag it down. Finally, you will have the values you need on F2:F25.
Find bellow my result.
Please let me know if you have any question so I can improve the answer.
I have a table of times logged per date (and a stack of other info not relevant here)
logTable
Date - Project - other stuff - Hours
1 Jul - X - ... - 3 hrs
1 Jul - Y - ... - 2 hrs
2 Jul - X - ... - 4 hrs
etc.
I then have a formula which calculates time per day:
Note that K3 is the start of the period (i.e. Monday) to calculate the time per day for.
=SUMIF(logTable[[#All],[Date]],"="&K3,logTable[[#All],[Hours]])
In plain English this would be "show me the total hours from all rows with date X" - and what I need is "show me the total hours from all currently visible, not filtered rows with date X"
It is a basic time-logging spreadsheet. The purpose of this particular part is to display amount of time per day for a selected week, filtered by various criteria.
Unfortunately SUMIF does not seem to support filtering tables.
How can I update that formula such that it will calculate time per day but only for unfiltered rows in logTable? For example, I may want to filter my table by project X, and have the output update to reflect that (note that this is just an example, the table may be filtered in many other ways - the solution needs to support table filtering).
There are lots of similar questions here but I have not been able to come up with a solution based on any. Part of the confusion I think is that I'm using table and column names and most of the solutions seem to use ranges and offsets, which I don't know how to use with named tables.
There are many ways to do this. Here is a selection
change your formula to use SumIFs instead of SumIF, then you can add more criteria.
=SUMIFS(logTable[hours],logTable[date],G2,logTable[project],G3)
Use SubTotal and filter the table. Subtotal will only calculate the visible cells
=SUBTOTAL(9,logTable[hours])
Use the new Filter() function available with Office 365 Excel.
=SUM(FILTER(logTable[hours],(logTable[date]=G2)*(logTable[project]=G3)))
In these examples, the date is in cell G2 and the project in cell G3. Adjust to suit.
I have a figure which is 2880 in cell A1 lets say it's a monthly salary and in this example there are 31 days in the month.
What I want to work out is what would be the weekly average of this figure. Considering it is just over 4 whole weeks - I can't divide by 4 as that's not accurate but then I can't divide by 5 either for the same reason.
So what I need is a calculation which can give me an exact weekly average - is this it all possible or am I trying to complicate matters?
Thanks
Dan
You can use the following formula where cell C2 is the number of the month (March would be 3):
=ROUND(C3/(DATE(1,C2+1,1)-DATE(1,C2,1))*7,2)
See screenshot of the example:
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.