Excel bottom up autofill/addition - excel

I need to fill and add up the values in column with the value below, if the value is null or 0, I want it to use the previous field value. This is part of my backlog calculation, and I can't find/remember the formula I used last time.
A is what I have, b is what I need
A B
21 34
6 13
3 7
1 4
1 3
2
1 2
1
1
1
1
1
1 1

What about:
=IF(ISBLANK(A1),B2,A1+B2)

Related

Excel Lag Two Group

STUDENT
TIME
CLASS
SCORE
WANT
1
1
A
13
NULL
1
1
B
4
NULL
1
2
A
11
-2
1
2
B
9
5
1
3
A
8
-3
2
2
B
16
NULL
2
3
B
6
-10
2
4
A
7
NULL
2
4
B
6
0
I have XLSX file with STUDENT, TIME, CLASS, SCORE. I wish to calculate WANT which does this:
For every STUDENT and CLASS, calculate the difference in SCORE from TIME(X) TO TIME(X-1).
for STUDENT=1, TIME=2,CLASS=B equals to 5 because it is (9-4)
I try this with no success:
=IF(A3=A2 & C3=C2, OFFSET(D3, -1, 0), "")
I think you can try:
Formula in E2:
=IF(COUNTIFS(A$2:A2,A2,C$2:C2,C2)>1,D2-SUMIFS(D:D,A:A,A2,B:B,B2-1,C:C,C2),"Null")
It is far from the best approach, but it works.
If using helper column is not a problem, you can make additional column for VLOOKUP (see column "Helper1") with formula =TEXTJOIN("-",,A2:C2).
Now use VLOOKUP to find value TEXTJOIN("-",,A2,B2-1,C2) in that column. Formula in "WANT" column: IFNA(E2-VLOOKUP(TEXTJOIN("-",,A2,B2-1,C2),$D$2:$E$10,2,FALSE),"NULL")
Result:

How to output the order where at least one column is filled with all positive number

I want to create a formula to output the order, where at least one column is filled with all positive values. In this case, the result should be order 11 and 12. Thank you.
order a b c
11 1 1 2
11 1 -1 -3
12 -2 1 -1
12 1 1 3
13 2 3 2
13 -1 -2 -3
Try below formula
=IFERROR(INDEX($A$2:$A$7,AGGREGATE(15,6,ROW($1:$6)/(($B$2:$B$7>0)*($C$2:$C$7>0)*($D$2:$D$7>0)),ROW(1:1)),COLUMN(A$1)),"")

In excel, how to use an array formula to sum a range to offsets of itself, generating a new "sum" range?

I'd like to use an array formula to sum a range to multiple offsets of itself: for example, given the following range: {3,4,5,6,7} (say in cells A1:A5), I'd like to get the range added to itself, say 4 times, but each addition is offset by one column. So the answer would be a range equal to {3, 3+4, 3+4+5, 3+4+5+6, 3+4+5+6+7, 4+5+6+7, 5+6+7, 6+7, 7}
Here is an example, offset by rows:
3
4 3
5 4 3
6 5 4 3
7 6 5 4 3
0 7 6 5 4
0 0 7 6 5
0 0 0 7 6
0 0 0 0 7
=
3
7
12
18
25
22
18
13
7
Put the following in your first desired cell:
=IF(ROW(1:1)< COUNT($1:$1)*2,SUM(INDEX($1:$1,IF(ROW(1:1)<COUNT($1:$1),1,ROW(1:1)-COUNT($1:$1)+1)):INDEX($1:$1,MIN(ROW(1:1),COUNT($1:$1)))),"")
Then copy down. As numbers are added or subtracted from the first row the answer will change to match. Just copy down sufficient rows to cover twice the greatest number of values in row 1.

how find unique value from Different column

A B ANSWER
1 1 1
3 3 3
1 2 1
2 4 2
4 4 4
5 5 5
6 6 6
i have used this function to get above answer "=IF(ISERROR(MATCH(A2:A8,$B$1:$B$8,0)),"",A2)"
but I need answer like this i have given below (suppose if you take value in A column "1"
Which is repeated only once in column B)
A B ANR
1 1 1
3 3 3
1 2 0
2 4 2
4 4 4
5 5 5
6 6 6
I've just wrapped your formula in a condition that returns 0 where the count of the A value from start to the current row is more than one:
=IF(COUNTIF(A$1:A2,A2)>1,0,IF(ISERROR(MATCH(A2:A8,$B$1:$B$8,0)),"",A2))
.
An alternative formula that gives the same results as above for the sample data provided but may (or may not) suit the additional requirements mentioned in a comment:
=IF(COUNTIF(A$2:A$10,A2)<=COUNTIF(B$2:B$10,A2),A2,IF(COUNTIF(A$2:A2,A2)>COUNTIF(B$2:B$10,A2),0,IF(COUNTIF(A$2:A$10,A2)>COUNTIF(B$2:B2,A2),A2,0)))

Dynamically determining range to apply formula/function in EXCEL

I need to determine the range to apply the Frequency function. Here's what the problem is. On the given sheet, I have subtotals for my data and there is a column which has "Stop" Values.
The data would look something like:
Route1
Order# Stop# Qty
001016 1 5
008912 1 5
062232 2 6
062232 3 2
069930 4 1
1000 4 3
1001 4 4
1001 5 8
1003 8 1
Route 1 Subtotal 6 35
Route2
Order# Stop# Qty
10065 1 5
10076 1 5
10077 2 6
10079 3 2
10087 4 1
10098 4 3
10109 4 4
10171 5 8
10175 8 1
Route 2 Subtotal 6 35
How do I write VBA code for calculating the distinct stop values. I need the distinct count of the stop#. Hence in the example above you can see that the total stops are 6 because 1 stop can have multiple orders and 1 route can have multiple orders/stop. Hope I am making sense here. Let me know how I would write my VBA code for this. Thanks for your help.
For the Stop Subtotal unique count, try this formula (adjust ranges as required):
=COUNT(1/FREQUENCY(B2:B10,B2:B10))

Resources