How to get values with addons = the value without the addons in excel. - 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)

Related

Finding a formula to compute partial sums for consecutive rows that satisfy a condition

How do I do this is excel. The example is provided below. If we don't sell any products on a specific day I would like to move those hours to the next date.
If you need to compute partial sums of Hours for all the consecutive rows between rows that satisfy the condition that the value Sold is greater than zero, you could do this with an auxiliary column
A B C D
---------------------------------
1 |Hours Sold Sums Solution
2 | 300 30 300 300
3 | 30 0 300 0
4 | 0 0 300 0
5 | 30 0 300 0
6 | 300 50 660 360
7 | 23 0 660 0
8 | 100 25 783 123
Here Sums is defined by a formula for C2
=IF(B2>0,SUM(A2:$A$2),C1)
You can automatically populate the cells below.
This formula puts in a cell a partial sum of Hours up to the current row if Sold is nonzero, otherwise copies the previous partial sum of hours. We need this to subtract this value on the next step.
When you have the column C filled, it is sufficient to put the following formula in D2 and populate the cells below
=IF(ROW(B2)>2,IF(B2>0,C2-C1,0),C2)
This formula handles correctly both D2 that does not have a preceding row with values and the remaining cells in column D.
In fact you could combine the two formulas together and avoid the need to have an auxiliary column. Put the following formula in C2 and spread it down to the rest of the cells in column C
=IF(ROW(B2)>2,IF(B2>0,SUM(A2:$A$2)-SUM(C1:$C$2),0),A2)
to get
A B C
---------------------------------
1 |Hours Sold Solution
2 | 300 30 300
3 | 30 0 0
4 | 0 0 0
5 | 30 0 0
6 | 300 50 360
7 | 23 0 0
8 | 100 25 123

Cumulative sum in excel with certain criteria

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"))

Excel Multiply one set of values with given matrix and sum results

I need to redistribute values for Old entries by using new distribution in a given table.
Example:
Need to redistribute using given % in this table:
So New Value of Element 1 = 99% * old1 + 7% * old2 + 3% * old3 + 26% * old5
This is not whole table, it is pretty large. There must be a simpler way than adding things up manually.
You can use the MMULT() worksheet function for that.
Example:
A B C D E F
1 Amount
2 100
3 200
4 500
5 400
6
7 Percentages 1 2 3 4
8 99 7 3 26 =MMULT(B8:E8;A$2:A$5)/100
9 1 93 34 0 =MMULT(B9:E9;A$2:A$5)/100
10 0 0 63 74 =MMULT(B10:E10;A$2:A$5)/100
For your information: I've entered the first formula in F8, and dragged and dropped until F10.

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")

AGGREGAT with critiera and duplicates in array

I have the following Excel spreadsheet:
A B C D E
1 ProdID Price Unique ProdID 1. Biggest 2. Biggest
2 2606639 40 2606639 50 50
3 2606639 50 4633523 45 35
4 2606639 20 3911436 25 25
5 2606639 50
6 4633523 45
7 4633523 20
8 4633523 35
9 3911436 20
10 3911436 25
11 3911436 25
12 3911436 15
In Cells D2:E4 I want to show the 1. biggest and 2. biggest price of each ProdID in Column A. Therefore, I use the following formula:
D2 =AGGREGAT(14,6,$B$2:$B$12/($A$2:$A$12=$C2),1)
E2 =AGGREGAT(14,6,$B$2:$B$12/($A$2:$A$12=$C2),2)
This formula works as long as the prices are unique in Column B as you can see on the second ProdID (4633523).
However, once the price is not unique in Column B (for example 50 for ProdID 26026639 and 25 for ProdID 3911436) the functions in Cells D2:E4 does not show the right results.
Do you have an idea if you can solve this issue with the AGGREGAT-Formula and wihtout using an ARRAY-Formula?
you could check number of occurences of the first ProdID-price combinations and use that in the last argument of the AGGREGAT function. So instead of
=AGGREGAT(14,6,$B$2:$B$12/($A$2:$A$12=$C2),2)
you would have
=AGGREGAT(14,6,$B$2:$B$12/($A$2:$A$12=$C2),2+COUNTIFS(A:A,C2,B:B,D2)-1)
of course you can just put "1+COUNTIFS..." but I put it this way so it can be better understood that it uses position 2 + number of occurences of the combination of ProdID with biggest number after the first occurence.

Resources