Sum column based on condition based on corresponding column in excel - excel

There are two column
A B
1 1
2 1
3 3
Now I want to sum column A if A-(B+C) is equal to 0.
so for above example sum would be 1+3 = 4

Adjust ranges as necessary:
=SUMPRODUCT((A1:A3=B1:B3)*A1:A3)

Related

Formula to Find if Number between a Range in 2 Columns and then Offset 1 column

I would like to write an Excel formula that looks at 3 columns and grabs value of the 1st column based on if the search value is in columns 2 or columns 3.
1st Column 2nd Column 3rd Column
a 1 5
b 6 10
c 11 15
Search Value 1: 13 Result: c
Search Value 2: 6 Result: b
Try below formula-
=INDEX($A$1:$A$3,MAX(($B$1:$B$3<=B6)*($C$1:$C$3>=B6)*(ROW($A$1:$A$3))))

Formula for deviation from mean agreement

I have a dataset in Excel and I want to compute a formula for deviation from mean agreement.
Suppose the dataset is like this:
A B C D E
4 2 6 9
1 3 2
7 2 1
8 4 3
5 1 2
What I want to calculate has formula as (summation from i=1 to 5 (i.e., from A to E) |R-R'|/t)/N where N = 4 for 1st row, N = 3 for 2nd row and so on that is, no. of non null values for that row. R is current value in the row and R' is mean of the column for which we are considering R and t is no. of non null values in that vertical or column.
You will need to use the ABS() function to get the absolute value of the subtractions. To get the number of non-null cells you can use the COUNT() function. To only include items in a row that are not null you can use an IF() statement.
For example, if you data was in the range A1:E5 then the following formula would get the result for the first row if I've understood the calculation you are doing correctly:
=(IF(LEN(A1)>0,(ABS(A1-SUM(A$1:A$5))/COUNT(A$1:A$5)))+IF(LEN(B1)>0,(ABS(B1-SUM(B$1:B$5))/COUNT(B$1:B$5)))+IF(LEN(C1)>0,(ABS(C1-SUM(C$1:C$5))/COUNT(C$1:C$5)))+IF(LEN(D1)>0,(ABS(D1-SUM(D$1:D$5))/COUNT(D$1:D$5)))+IF(LEN(E1)>0,(ABS(E1-SUM(E$1:E$5))/COUNT(E$1:E$5))))/COUNT($A1:$E1)
Which results in 2.4853 for row 1

Look up for highest value from another column if values are equal excel

***1 2 3***
a 2 3
b 3 4
c 4 3
d 5 2
so I know to get the highest value I do
=INDEX(column1, MATCH(MAX(column3), column3, 0))
... which would give me 'b'
now I want to get the second highest value based on the column 3 but because there are two cells with 3 (which is the second highest value) I want to use the one that has the lowest value in column 2 based on those two rows. Is this possible?
Use a 'helper' column that adds column C + (column B ÷ 10) and use a modification of your original formula on that column.
        
The standard formula in F5 is,
=INDEX(A$2:A$5, MATCH(AGGREGATE(14, 6, D$2:D$5, ROW(1:1)), D$2:D$5, 0))
Fill down as necessary.

Keep on summing corresponding cell and compare with first column for summing up first column based on comparision in excel

Consider the following data setup:
_A_ _B_ _C_
1 1
2 1 1
3 3
Such that a formula would return the following results for columns B and C respectively:
_A_ _B_ _C_
4 2
Now I want to sum column A if A-(B+C) is equal to 0.
so for above example sum would be 1+3 = 4 on column B, since row 1 and 3 satisfy 1-1=0 first row, 3-3=0 third row. so A value on 1st and 2nd row is 1+3=4. Row 2nd doesn't satisfy 2-1=1 not 0 so ignore.
on column C, B+C in second row 2-(1+1) = 0 ,So it would be sum 2 in that column C, ignoring first and third row since it already has been counted on column B.
columns continue like D E....
So sum up from B to current column..so if i am in column B it will sum up till B.If in C B+C....If in D B+C+D etc and then compare with column A
Insufficient rep to comment, this is at least a partial answer and perhaps full.
I think you're looking for this to happen in some lower row in B:
=SUMPRODUCT(--(A1:A3=B1:B3),A1:A3)
And this in C:
=SUMPRODUCT(--(A1:A3-(B1:B3+C1:C3)=0),A1:A3)
Although as EEM points out all the sample rows satisfy this condition so you get "6" instead of "2"

Filtering values based on comparisons with adjacent columns

I want to compare column A in sheet 1 with column A in sheet 2, and only return matches from sheet 2.
I then, want to use the matching column A rows as a basis for a second comparison. The second comparison is to compare column B in sheet 1 with column B in sheet 2 and only return non matches from sheet 2.
Assume this is the data on sheet 1:
A B
2 4
2 4
2 3
3 3
and this is the data on sheet 2:
A B
2 4
3 3
2 4
3 3
So, only the third row will pass on both conditions. Any ideas how this can be done?
I want to compare column A in sheet 1 with column A in sheet 2 and only return matches from sheet 2
Type on cell C1, on sheet 1:
=IF(A1=Sheet2!A1,"True","")
Drag the formula to all rows on column A, which contain non blank cells.
The second comparison is to compare column B in sheet 1 with column B in sheet 2 and only return non matches from sheet 2.
Type on cell D1, on Sheet 1:
=IF(AND(C1="True",B1<>Sheet2!B1),"True","")
Drag the formula down.
Output on Sheet 1 should be like that:
A B C D
2 4 True
2 4
2 3 True True
3 3 True
Filter column C by True to observe the "first" condition's returns. Do the same to column D to retrieve the data which satisfies the "second" condition.

Resources