Calculating Year-To-Date Accuracy removing predicted forecasts - excel

I have an Excel spreadsheet and looking to add what I think will be a simple formula.
The calculation I am looking for is to calculate the Actual Year-to-Date (YTD) percentage of delivery performance.
Currently the YTD calculation takes the sum of cells B13:G13 (Bulks Accurate) divided by the sum of cells B4:G4 (No of Bulks Due per week). This doesn't show an accurate YTD as it also includes the forecasted number of bulks due in weeks 5 and 6. I am looking for a formula that will include a statement to say if the yellow cells in row 6 are not completed then the YTD calculation will not include the forecasted bulks due in row 4.
Thanks for your help in advance!
YTD Spreadsheet Image

Could you change the logic of row 11 (No of Bulks) to show the value in row 4, but only if row 6 AND 7 are blank? An IF AND formula would suffice, entered in B11 and then copied across:
=IF(AND(B6="",B7=""),0,B4)
Then, your YTD formula can be simply
=SUM(B13:G13)/SUM(B11:G11)
This way, even if no delivery has taken place when due, you enter "0" and the % will then include that week's due figure in the overall calculation.
1st Example Spreadsheet Img
If you can't change row 11 because it needs to match row 4, then you could insert a new row to implement the IF AND formula and amend my YTD formula above to use the new row instead of row 11.
If you can't add to the structure of your table at all, then you can still achieve the same result by using a SUMIFS as your divisor, as below:
=SUM(B13:G13)/SUMIFS(B4:G4,B6:G6,">=0",B7:G7,">=0")
The only difference with the SUMIFS route, is both the row 6 and row 7 values must be set as at least 0 for it to include row 4's value. The first route means row 4's value is included as soon as row 6 OR row 7 have a value entered.
2nd Example Spreadsheet Img

Related

Excel SUMIF Offset

I have a spreadsheet that is used for inventory planning. It has, in columns, 5 weeks (per month) followed by a month total, then another 5 weeks, followed by another month total, and so on for 12 months. Each week column is labelled "Wk 1", "Wk 2" and so on. Each Month is labelled as "Jan", "Feb" and so on.
I have the product code at cell A2, and a lead time (in weeks) at cell C2. The lead time varies by product.
Column B is the first column with data (column A is used for labels).
On row 5 there is opening stock on hand.
On row 6 there is the sales forecast.
On row 7 there are Purchase Orders received.
On row 8 is closing stock on hand.
Row 10 is a staging area. This is my problem row. These are my planned orders.
My cell B10 formula is =SUM(B6:OFFSET(B6,0,C2-1)). My planned purchase order = planned sales for the next x weeks, so I need to exclude the month columns.
The result should be as shown in cell B11. Formula for that cell is =SUM(B6:F6)+SUM(H6:K6)+SUM(N6:R6). Note that cell L6 is excluded.
Not sure how to increase the number of columns to include in the offset as a lead time may be 26 weeks, so there could be a few "month" columns I need to exclude, and then how to exclude the monthly totals?
I'm thinking maybe using a Sumif combined with Offset, but I am scratching my head.
Your help will be much appreciated.
Image of Excel file showing structure
Havent tried anything, as am unsure what to try.
see attached photo for your answer.
The formula you seek for cell B10 is:
=SUMIFS(OFFSET(B6,0,0,1,C2+(COUNTA(B4:ZZ4)-COUNTIF(B4:ZZ4,"wk*")+COUNTIF(B3:ZZ3,"exclude"))),OFFSET(B4,0,0,1,C2+(COUNTA(B4:ZZ4)-COUNTIF(B4:ZZ4,"wk*")+COUNTIF(B3:ZZ3,"exclude"))),"=wk*")
Solution

How do I create a formula that will return a date where the sum of it and previous dates are greater than some requested number?

Example of Product Data and Inbounds
I have 20 products that I sell that each have some requested amount that people want to buy. I am struggling to figure out a formula by which I could have it return the week where the sum of it and previous weeks is greater than the amount requested, so I know on what week of inbounds the order can be fulfilled.
The example data only shows three columns of dates but in reality there could be up to 20 weeks of inbounds inventory, so it would be potentially a large series of sums before it finds the one greater than the amount requested. In the example image the cells highlighted in green are the correct week for each product that I manually marked.
Thanks for the help, I'm not sure where to even start on this.
Assuming that your table start in cell A1 (therefore the cell C2 value is 96), use this formula for your conditional formatting starting from cell C2:
=AND(SUM($C2:C2)>=$B2,SUM($B2:B2)-$B2<$B2)
Warning: the formula might stop working if the overall structure of the table is changed. For example: if columns with non-numeric data are inserted, the user will need to re-apply the conditional formatting. If said inserted columns will contain numeric value that are not meant to be sum in the formula, it won't suffice anymore.
I am afraid I don't have time to write a full answer but the below might help. I am sure there is a way to avoid writing multiple COUNTIFS with a SUMPRODUCT but I haven't got there yet.
=SUM(1,
COUNTIFS($B3,">"&$C3),
COUNTIFS($B3,">" & SUM($C3:$D3)),
COUNTIFS($B3,">" & SUM($C3:$E3))
)
This is a model built around your having 20 weeks so that you can have one formula which doesn't require continuous adjustment - it does require one column of helper cells for each week, though:
the helper cells start in column Y, where the formula in Y2 is
=SUM($C2:C2)
which is then copied to the right as far as column AR, and then copied down, one row for each of your products.
With all of the helper cells populated, the array formula in W2 is
=IFNA(INDEX($C$1:$V$1,MATCH(1,N((Y2:AR2-B2)>0),0)),"In the future")
which is then copied down, one row for each of your products.

Counting Available Days in a Row

I'm trying to calculate the number of consecutive available days I can schedule my drivers. The schedule I've included shows a date range of 12 days, starting with the day prior. I've tried everything I know but haven't had any luck. For analysis purposes I've boxed and highlighted the "available days" and included a column titled "desired results". The total driver counts are in the hundreds and the future available days are interrupted by other activity on a driver's schedule. My need is to count the blank slots that start today and end with the first populated cell on that driver's schedule (by row).
As far as I can understand, you want to count the number of blank cells beginning in column B until the next populated cell in each row, the following formula will help you achieve your desired results:
=IFERROR(IF(AND(MATCH(TRUE,INDEX(B2:L2="",0),0)=1,MATCH(FALSE,INDEX(B2:L2="",0),0)<>1),MATCH(FALSE,INDEX(B2:L2="",0),0)-1,0),0)
In essence the formula will check if the first Cell in the range (ie. Column B) is blank, then it will check for the first non blank cell in the row, and then give you the results, all this is wrapped in an IFERROR to convert errors to 0.
So it looks like you want to count how many empty cells are in each row, columns B:L, until first non empty cell is found:
My formula in M2 is:
=MATCH("*";B2:L2;0)-1
Drag it down and hope you can adapt it to your needs.

Never include cell value in excel calculation

tl;dr Is it possible to label cells as 'ignore' (or equivalent) so that if they are included in the range of a SUM function, they are not included in the calculation and therefore outputted value?
I have created a complex table that depicts revenue over the next few years. The table rows run continuously through the months with no break between December of one year and January of the next. I have realised I need to put in a Total column at the end of each year. If I select each Jan column and click insert, I get a vacant column at the end of each year that can be used for my total column (to the left of each Jan). However, I use SUM extensively in each row and I do not want any of the cells in the Total columns to be included in any of the calculations of the cells for the months. Is it possible for me to write my formulae in each Total column cell and then somehow specify that I do not want this value to be included in any calculations at all i.e. is there some sort of 'ignore' label i can apply to these cells? I know the alternative is to manually change each formula, but I have 5 years worth of predictions each with 50 rows and each cell has multiple SUM functions in it...
Say we have values in column A from A1 through A400, but some of the items are intermediate subtotals, etc. We want to sum column A, but omit the subtotals.
In column B place a 1 in rows that you want to process and a 0 in rows you want to skip
Then use:
=SUMPRODUCT((A1:A400)*(B1:B400))
Two options:
Use the SUBTOTAL function to calculate those subtotals, and the AGGREGATE function to do the sum at the end, as it has an option that lets you ignore SUBTOTAL results.
Use a PivotTable. You can then easily subtotal by year or whatever else you want.
I would personally go for option 2

Updated Weekly Comparison between two values

I am trying to make an excel for keeping track of body weight.
On each SUNDAY, the new weight will be inputted by the user, this will go on for an infinite amount months. I want to be able to calculate the difference between last Sunday's input and the current Sunday's input when a new weight is inputted, then display the difference in a cell.
The problem is, I can do this for the first two inputs, but I want it so once you have 4 inputs, it will no longer use the 1st two weights for the calculation, but the 3rd and 4th, and same with 8 inputs, where it would use the 7th and 8th input for the calculation instead of 1st-6th and so on.
I have tried conditional formatting and if's, although it does not get the "use newest 2" effect I want. What could I use to do this?
Make sure you have a 'spare' column to the left of your weights. Let's take column A as the spare and then record your weights in column B. Allowing for column headings and generally laying things out nicely, let's say your first weight data is in cell B4, then the following week's data is in B5 and so on. In cell A4 enter the formula:
=A3+IF(B6=0,1,0)
Now copy this formula down for as many rows as you need in column A. Your formula to get the difference between the newest two weights is:
=VLOOKUP(2,A:B,2,FALSE)-VLOOKUP(1,A:B,2,FALSE)
[EDIT - allowing for 'calendar' view]
For you calendar view you are going to need a spare row above your weight data. You could hide this row if you wanted. Allowing for blank cells between your inputs I would use a slightly different technique. In this spare row (e.g. cell D2) put the formula:
=C2+IF(D3=0,0,1)
Copy this formula all the way to the right. The formula for your newest difference calculation now becomes:
=HLOOKUP(MAX(2:2),2:3,2,FALSE)-HLOOKUP(MAX(2:2)-1,2:3,2,FALSE)
If the entries will consistently be on a Sunday and on a weekly basis and you were happy to include the date in column A and your weight in column B then keep a rolling formula in column C:
In row 5: =b5-b4
In row 6: =b6-b5
This formula in column C can be dragged down using the small box in the bottom right of the cell and will automatically change the row number for you.

Resources