Contruct cumulative sum for duplicates - excel

I am looking for formula in Excel to construct cumulative sum for the duplicates.
Item Value Cumulative sum
-----------------------------
A 3 3
A1 4 4
A1 7 11
A1 5 16
B1 20 20
B1 4 24
C 6 6
D 10 10
E 8 8
E 7 15
The table given shows the cumulative for the duplicates in Column 1(Item).
I need excel formula to construct this for my calculations.

Break problems like these down step-by-step.
(Assume your data are in A1:C11 (col C is empty except for the header).)
To calculate a cumulative sum, you just add the current value in col B to the previous value in col C. This is simply =C1+B2 in C2, =C2+B3 in C3, etc.
To evaluate whether you are in the same group of Item, you can simply test whether A2=A1, A3=A2, etc.
To reset your cumulative sum when the group changes, you can use an IF() function. In (2), you have a logical condition. In (1), you have an operation to perform if the condition is true. If the condition is not true, you want to reset the cumulative sum, which is simply the value of col B in the current row.
So to put it together (in C2):
=IF(A2=A1, C1+B2, B2)
Then fill down.

Related

Check if column values are increasing

I got an Excel sheet like:
A B C
1 L11 6
1 L21 10
1 L31 20
2 L12 5
2 L22 15
2 L32 23
I want to make a formula to check if each consecutive 3 values in column C are increasing. How can I do it?
I've tried to group by but was invain
If the value 6 is in C1, then you could put the following formula in D3: =AND(C3>C2, C2>C1)
Copy it down. If it's TRUE, it means that each consecutive 3 values in column C are increasing.
If you want to quantify the trend here I am using a simple formula to calculate the slope for the 3 numbers using the values in y axis.
Formula
=SLOPE(N2:N4,{1;2;3})

Dragging formulas across - Increment columns by more than 1

I can't seem to find anything similar that's already been asked (they all relate to incrementing row numbers rather than columns)
I'm looking to drag a formula across horizontally and have the columns increment by 2
E.g. B1-A1, D1-C1, F1-E1...
Thanks!
You'll need to have a value in cell A1 and B1 for the following to work.
For my testing I put the number 1 in A1 and B1.
Try this in Cell C1:
=IF(MOD(COUNT($A$1:B1),2)=0,COLUMN(B1),IF(B1<>A1,B1,A1))
Here's what you should see when you drag that formula across:
A B C D E F G H I J K L M N
1 1 2 2 4 4 6 6 8 8 10 10 12 12
And this is what the formula does:
The MOD(COUNT() part of the formula counts the cells to the left of it, and if they are a multiple of 2, the value changes.
I've left the value to change to (the 'new' value) as the COLUMN() number for the cell before, just for example's sake. but you can change this part.
The last IF statement at the end checks if the cell before is equal to the cell before that, (eg. Is CELL C1 equal to CELL B1) and if they are not equal, it will give the cell before as a value (the 'copy' value).

How to get weighted sum depending on multipliers in column in Excel?

I have the table in Excel:
In column C (Sum) I want to get sum this way:
If in column A or B value is 1 then take Amount 48 and multiply by Multiplier (1) = 2.
If in column A or B value is 0 then take Amount 48 and multiply by Multiplier (0) = 1,5.
Then K1 and K2 summed.
So for row 2 the result in column C will be: 48*2 + 48*2 = 192.
For row 5 the result in column C will be: 48*1,5 + 48*2 = 168.
Is it possible to automate this process using Excel formula for C column (inspite of number of columns)?
Or you could use Countif (no shorter though)
=COUNTIF(A2:D2,0)*I$2*I$1+COUNTIF(A2:D2,1)*I$3*I$1
Use Ctrl+Alt+Enter when entering (since it's an array formula)
EDIT: I'm not great with formulas, so there is I'm sure a shorter alernative...

I WANT CALCULATE SUM IN EXCEL

I HAVE A QUESTION ABOUT SUM IN EXCEL:
I have many rows in excel.
I want to calculate sum of each row in one formula
for example
A B C D E
2 3 5 6 8 24
4 5 6 8 9 32
BUT do not USE separate formula FOR EVER CALCULATION (FOR EXAMPLE =sum A1:D1)
CAN I USE WITH ONE FORMULA TO CALCULATE SUM OF EVERY ROWS
You do not have to manually enter the formula to calculate sum of every row.
In the first row you would input =SUM(A1:D1) (did you mean to include E1 as well?)
Then follow the instructions here to apply it the other rows

Compute MIN and MAX in table column according to some condition

I have a datasheet with 5 columns, 3 for input values and 2 for output values
A) Date
B) Number
C) Number
D) Number
E) Number
Column B has set of dates with possible repetitions.
Column C has the max value (and Column D has the min value) for an observation in a given date, which is the one in column B. Some values may be empty.
Given that in B I can have repetitions, I need to compute the following: for any given date in B, compute the max (or min) of all observations for that date and store it in column D (or E).
I cannot use MACROs.
Example.
Suppose D1 and D2 are valid dates
Input:
A B C
D1 9 3
D1 8 2
D2 7 5
D2 3
Output:
A B C D E
D1 9 3 9 2 (the max for all dates of type D1 is 9, while the min is 2
D1 8 2 9 2
D2 7 5 7 3 (the max for all dates of type D2 is 7, while the min is 3
D2 3 7 3
How can I do that?
=MIN(IF(A:A=A4,C:C)) works for me, if you add Control+Shift+Enter when you're in the cell.
It looks like excel adds {} around the whole formula when you do.

Resources