Rolling available Calculation - excel-formula

What I think I am looking for is a rolling calculation, for example:
If A2 = F2:F4 Then subtract B2 from G2 and add C2 with result in D2. This would continue until it reaches the same part again like in rows 3,4,8,and 10. Once a part is repeated rather than looking at the column G I would like it to use the latest value in D.
A3 = F2:F4 subtract B3 from G3 and add C3 with result in D3 (20-5+0-15)
A4 = F2:F4 subtract B4 from D4 and add C4 with result in D4 (15-2+0-13)
A8 = F2:F4 subtract B8 from D8 and add C8 with result in D8 (13-8+7-12)
A10 = F2:F4 subtract B10 from D10 and add C10 with result in D10 (12-2+0-10)

Use VLOOKUP to return the correct start, and SUMIFS with dynamic range to do the subtraction and addition.
=VLOOKUP([#PART],Table3,2,FALSE)-SUMIFS($B$2:B2,$A$2:A2,[#PART])+SUMIFS($C$2:C2,$A$2:A2,[#PART])
Note: to use only structured references we need to introduce the volatile OFFSET:
=VLOOKUP([#PART],Table3,2,FALSE)-
SUMIFS(OFFSET(Table2[[#Headers],[QTY]],1,,ROW()-ROW(Table2[[#Headers],[QTY]])),OFFSET(Table2[[#Headers],[PART]],1,,ROW()-ROW(Table2[[#Headers],[PART]])),[#PART])+
SUMIFS(OFFSET(Table2[[#Headers],[DELIVERED QTY]],1,,ROW()-ROW(Table2[[#Headers],[DELIVERED QTY]])),OFFSET(Table2[[#Headers],[PART]],1,,ROW()-ROW(Table2[[#Headers],[PART]])),[#PART])

Related

ForLoop VBA Coding Hardcoded values

Values Entered into Excel
A2 =4
A3 = 2500
C2= 15
D2= 30
E2 =35
F2= 40
Values to Populate:
I want to populate cells starting in cell C5 through Cells [C5 + (value in A2)] with the value in A3
So in this example C5 through F5 with the value in A3 (2500)
I want to populate cells starting in C6 through Cells [C6 + value in A2) with the corresponding cell values in (C2 + value in A2)
so in this example C6 = C2, D6 = D2, E6 = E2, F6 = F2
You only populate as many columns across as the number in A2

How to convert particular columns into rows?

I want to convert particular columns into rows. How can I do that? For example, I want to shift C2 to D1 and C3 to E1 in sheet 1. Below is the link for the same sheet:
https://drive.google.com/open?id=1GifSZqk9UXbne1CORGWEBTjm_ns_U9dI
In cell D1 put formula: =C2
In cell E1 put formula: =C3
Assuming you need this to do the same in D4 and E4 select range D1:E3 and drag down.

How to count Based on Dynamic Range in excel?

Excel Image
I want to loop through Coloum to bring the value as the following Example:
in Cell E4
If A4 >= C4 && A4 <= D4, Bring the value of B4
If A5 >= C4 && A5 <= D4, Bring the value of B5
If A6 >= C4 && A6 <= D4, Bring the value of B6
Up to
If A27 >= C4 && A27 <= D4, Bring the value of B27
then I will sum all the brought values.
Then to continue in Cell E5 with the same criteria up to cell E27
There are a few days to do this but the easiest is probably with SUMIFS.
For example, this:
=SUMIFS(B:B,C:C,"<="&A:A,D:D,">="&A:A)
...will give you the sum of cells in Column B where Column A is between Column C and Column D.
(This tested fine on a couple rows that I tried but that's all I was willing to test since (as was mentioned) an image of your data isn't very helpful.)
You can adjust it to contain whichever area needs to be included/excluded and you can use add the results of multiple SUMIFS functions to sum results from different areas.
More Information
Office.com : SUMIFS Function (with Video)

Excel formula with diagonal

I have a question for executing quickly.
A1:C3 is original. I want to create a new based on it and F1:F3.
A8 is A3 / F1.
A7 is A2 / F2.
A6 is A1 / F3.
B7 is B2 / F1.
B6 is B1 / F2.
C6 is C1 / F1.
I want to use formula to do this rather than input A8 = A3/F1. And do it many times in each cells.
How can I do?
This formula should do it:
=IF(A1<>"",A1/INDEX($F$1:$F$3,1+(ROW()-ROW($A$6)+COLUMN()-COLUMN($A$6))),"")
You have to put it in A6 and copy it to the other cells.
(#Rob Gale: ok :-) )
First you have to check for empty cells (A1<>"").
Then the numerator of the division is simply a reference and can easily copied between the formulas (A1).
The tricky one is the nominator. The sum of the row and column offsets of the respective cell is calculated and used as index into the 'percentage range' in column F.
Select A6:C8
Press F2
Copy and paste this formula
=CHOOSE({1,2,3;4,5,6;7,8,9},A1,B1,C1,A2,B2,C2,A3,B3,C3)/CHOOSE({3,2,1;2,1,1;1,1,1},F1,F2,F3,F1,F2,F3,F1,F2,F3)
Press Ctrl+Shift+Enter

Concatenate and fill but not continuously

I have an excel sheet that I need to concatenate a couple of cells and then add a number. I want something like:
A1
A2
A3
A4
B1
B2
B3
A5
But instead, I get:
A1
A2
A3
A4
B5
B6
B7
A8
Is there a way to achieve what I want?
Thank you
Does this work for you? Added a helper column.

Resources