Cumulative sum in excel with certain criteria - excel

I have typed out an equation that I have dragged it down in a column in my excel table. I think I’m fairly close… and would love some feedback around this.
I want cumulative sum of the first cell $J$3 to the cell row it’s currently on (J53 for example). And I want cumulative sum of the particular cells that meet these conditions (ie… COUNTIF($B$3:B53,B53)*COUNTIF(AC53,1).
I know the Sumif() statement below isn’t correct… but this was as close as I could get!
=IF((COUNTIF($B$3:B53,B53)*COUNTIF(AC53,1)),(SUMIF($J$3:J53,J53)),0)
As shown in the table below
Projectid(B)
successornot(AC)
production(J)
result I want
1
1
20
20
1
1
40
60
1
1
10
70
2
0
20
0
2
0
400
0
3
1
20
20
4
0
1
0
5
0
24
0
6
0
50
0
7
1
10
10
7
1
40
50
7
1
20
70

Give a try on
=IF(B2=0,0,SUMIFS($C$2:$C2,$A$2:$A2,A2,$B$2:$B2,">0"))

Related

How to multiply each row and then sum it with the product in the next row etc

I am trying to calculate total for each month based on Score and Number of occuruencies each month:
Category# Score Jan-18 Feb-18 Mar-18 Apr-18
category1 10 1 5 1 5
category2 8 2 4 2 4
category3 7 3 3 3 3
category4 6 4 0 4 0
category5 5 0 1 0 1
TOTAL 71 108 71 108
In the essence, for January I could type the following formula:
=($B$2*C2)+($B$3*C3)+($B$4*C4)+($B$5*C5)+($B$6*C6)
But it is very clumsy, so I am wondering if I could something more elegant and clean
that is what SUMPRODUCT is for
=SUMPRODUCT($B$2:$B$6,C2:C6)
Use SUMPRODUCT. It's exactly what you need:
SUMPRODUCT function
I replied your data:
The formula I have used is:
=SUMPRODUCT($B$4:$B$8;C4:C8)
After applying to first column (Jan-18), just drag it to the right, and it should return the right values, as you can see in the image.
Hope this helps!

Conditionally highlighting totals that don't match a dynamically summed range

Objective:
I am looking to use conditional formatting to highlight cells in rows that are not equal to the sum of a dynamic range.
Problem:
While the formula I have created seems to work when pasted into cells, it does not give the same results when entered as a conditional formula.
Example:
Here is a space delimited example to be pasted into "A1":
Allo d1 d2 d3 d4 d5
Total 10 10 10 10 10
A 9 9 10 10 9
B 0 0 0 0 0
C 0 1 0 0 0
Total 12 12 12 12 12
B 0 5 0 3 4
C 12 7 8 8 8
Total 12 12 12 12 12
A 0 0 0 0 0
B 0 0 0 0 0
C 0 5 0 3 4
D 12 7 8 8 8
I wrote this formula which shows TRUEs and FALSEs correctly when pasted into "H2" and dragged to the right and down to "L13." When I apply this formula to the data range "B2:F13" it does not mimic what I'd expect.
=IF($A2="TOTAL", B2 <> SUM(INDIRECT(ADDRESS(ROW(B3),COLUMN(B3),4)&":"&ADDRESS(ROW(B2)+IFERROR(MATCH("TOTAL",$A3:$A$13,0)-1,ROW($A$13)-ROW($A2)),COLUMN(B2),4))))
Below you can see the formula broken out in a more easy to read way. Is my formula flawed/ How can I accomplish what I am trying to do? I appreciate your thoughts.
=IF($A2="TOTAL",
B2 <> SUM(
INDIRECT( ADDRESS( ROW(B3),
COLUMN(B3),
4) &":"&
ADDRESS( ROW(B2) + IFERROR(
MATCH( "TOTAL", $A3:$A$13, 0)-1,
ROW($A$13)-ROW($A2)),
COLUMN(B2),4))))
Use OFFSET instead:
=IF($A2="TOTAL",B2<> SUM(OFFSET(B3,0,0,IFERROR(MATCH("TOTAL",$A3:$A$13,0)-1,ROWS($A3:$A$13)),1)))

Distinct Count Duplicate Value

I need help for distinct count for duplicate value and output required as follows.
If Column A's value is 28 the result should be unique1(Column E) Else if Column A's value is 29 then the result should be Column F(Unique2)
Code Product Quantity Weight Unique1 Unique2
28 Apple 9 100 1 0
28 Orange 9 100 1 0
28 Apple 9 100 0 0
29 Apple 9 200 0 1
29 Apple 10 100 0 1
29 Apple 10 100 0 0
28 Orange 9 200 1 0
I tried Mr.tigeravatar code and it is working fine, but I don't know how to add an if ... else condition for checking and output in a different column.
For validation try this code: paste it in cell G2 or whatever preceding columns in row 2.
=IF(OR(AND(A2=28,E2=1,F2<>1),AND(A2=29,E2<>1,F2=1)),"Correct","Incorrect")

How to get values with addons = the value without the addons in excel.

So below I have illustrated what I am looking to achieve in the end. I am wondering if it is possible to have the variation items (i.e. items with -LA or -LED) of the original item numbers (i.e. 1114 or bb2569/10) equal the same quantity in column B. The ending quantity should be based off of the original quantity from the original item number, i.e. 1114 or bb2569/10. This is only a small percentage of a much larger table of items and quantities.
This is what the code looks like now:
Item number Quantity
1114 5
1114-LA 0
1114-LED 0
225896 20
129239 17
225896-LA 0
225896-LED 0
114895 91
114895-LED 0
114895-LA 0
bb2569/10 42
bb2569/10-LA 0
bb2569/10 -LED 0
A22596 0
T-22265587 7
here is what i need it to look like in the end:
Item number Quantity
1114 5
1114-LA 5
1114-LED 5
225896 20
225896-LA 20
225896-LED 20
114895 91
114895-LED 91
114895-LA 91
bb2569/10 91
bb2569/10-LA 42
bb2569/10 -LED 42
A22596 0
T-22265587 7
Put this in C2 and Drag/Copy Down:
=SUMIF(A:A,TRIM(LEFT(A2,IFERROR(FIND("-L",A2)-1,LEN(A2)))),B:B)

Excel multiple search/match and sum (edit: answered with SUMIFS, COUNTIFS)

I am looking for help to solve this excel problem.
Essentially I want to create a formula for cells in column F which does a multiple search on 3 criteria (on cells in columns A,B,C) and want to access the corresponding column D values where all these (multiple) matches occur, and sum this in column F. I'd also like a count of the amount of matches found to calculate the value in column F; placed alongside in column G.
e.g.
IF col_A_value (anywhere in whole A column) = current_col_A_value +/- 1
AND col_B_value (anywhere in whole B column) = current_col_B_value +/- 1
AND col_C_value (anywhere in whole C column) = current_col_C_value - 1
THEN (output in column F) the sum of all values from row D where this criteria is met
(also, as a seperate but related cell formula, output in column G) the total Count of times this occurs.
Note: the values in columns A,B,C are all integars and the +/- above means to search for any values which are either +1, 0, or -1 different in value. (i.e. this includes the value itself).
e.g. If the value in cell A1 = 10, B1 = 45, C1 = 881, then the first search criteria would look for all other rows with values of 9, 10 or 11 in column A. Then based on these rows, the second search criteria would refine the search to only those rows which also include either a 44, 45 or 46 in column B, and the third search criteria would refine the search again to only include those rows where the column C value is 880.
Next, the values in the column D cells from all of these 'filtered' rows would be summed and the result placed in the column F cell. (The count of these results rows would be put in column G. (seperate formula required))
Since these are all unique entries (think of columns A,B,C creating unique vector coordinates in space), there should be a maximum of 9 entries found and summed. A +/-1: 3 variations, B +/-1: 3 variations and C -1 only: 1 variation. In total: 3x3x1 = 9 unique rows maximum (and potentially none as a minimum, as in the below example).
(If no match is found a value of 0 is good.)
Example with A,B,C,D and E as given values, and column F values calculated (together with the count shown in col G):
A B C D E F G
1 1 1 90 8 0 0
1 2 1 80 6 0 0
1 3 1 70 1 0 0
1 4 1 60 6 0 0
2 1 1 50 1 0 0
2 2 1 40 8 0 0
2 3 1 30 6 0 0
2 4 1 20 8 0 0
3 1 1 10 8 0 0
3 2 1 11 6 0 0
3 3 1 12 1 0 0
3 4 1 13 1 0 0
1 1 2 99 8 260 4
1 2 2 89 6 360 6
1 3 2 79 1 300 6
1 4 2 69 6 180 4
2 1 2 59 1 281 6
2 2 2 49 8 393 9
etc
To illustrate how column F values are calculated here is the working:
260 = 90+80+50+40
360 = 90+80+70+50+40+30
300 = 80+70+60+40+30+20
180 = 70+60+30+20
281 = 90+80+50+40+10+11
393 = 90+80+70+50+40+30+10+11+12
Thanks a lot for any help with this!
These formulas should do what you desire:
F1: =SUMIFS(D:D,A:A,"<="&A1+1,A:A,">="&A1-1,B:B,"<="&B1+1,B:B,">="&B1-1,C:C,C1-1)
G1: =COUNTIFS(A:A,"<="&A1+1,A:A,">="&A1-1,B:B,"<="&B1+1,B:B,">="&B1-1,C:C,C1-1)
The formulas can simply be copied down as you need them...
(Still I don't know what col E is for)

Resources