How to find if a number in a row matches a number in a column, and then automatically offset the number in the column to another value - excel

How to find if a number in a row matches a number in a column, and then automatically offset the number in the column to another value. For example:
Row 0 1 2 3 4 5
Answer x x x x x x
Column
0 100
1 340
2 500
3 266
4 455
5 800
So if "0" in the Row array matches "0" in the Column array, then show 340 and so on. I can to this with nested IF statements but is there an easier way if you have 100s of columns. Thanks

Related

Finding maximum value in group

I want to create a column of data that finds the largest value in column BD, based on individual values in Column B. I would have thought this equation would work! Anyone have any recommendations??
(first attempt)
=IF(BD3=0,0,SUMIFS($BD$3:$BD3,$B$3:$B3,B3,$BD$3:$BD3,MAX($BD$3:$BD3)))
(Second attempt)
=IF(BD3=MAXIFS($BD$3:$BD3,$B$3:$B3,B3),MAXIFS($BD$3:$BD3,$B$3:$B3,B3),0)
Projectid(B)
cumulative production(BD)
result I want()
1
20
0
1
60
0
1
70
70
2
0
0
2
0
0
3
20
20
4
0
0
5
0
0
6
0
0
7
10
0
7
40
0
7
60
60
this code should work:
=IF(MAXIFS($BD$1:$BD$12,$B$1:$B$12,A1)=BD1,MAXIFS($BD$1:$BD$12,$B$1:$B$12,B1),0)
If you have access to LAMBDA() function then can use below formula at one go.
=LET(a,BYROW(A2:A13,LAMBDA(x,MAXIFS(B2:B13,A2:A13,x))),IF(B2:B13=a,a,0))
Similar to SUMIFS you find MAXIFS
https://support.microsoft.com/en-us/office/maxifs-function-dfd611e6-da2c-488a-919b-9b6376b28883
Then just compare the MAX with the actual row value.
Edit based on your reply:
One way is to start with one operation in the cell first then it is easier to follow.
Your MAXIF should be like this (looking for the max in column B of those rows having the same value in column A as the value of current column A)
=MAXIFS(B$2:B$13;A$2:A$13;A2)
Then compare to B2
So, basically you got it, need just to adjust your second part of the MAXIFS :-)

calculating max value ocurrance for each row formula in excel

A B
1 4
2 5
3 6
100 7
1000 8
how can find number of max value of column values for each row.
=COUNTIF(A1:B5,A1:A5) trying this but this gives 0. I expected 2.
Since; 100 and 1000 are the max values of their rows. need only max value times for rows for A
This is one of the ways you can do it.
Should give you 2.

Find summation and count only if they are EQUAL in Excel

In EXCEL sheet I have 1728 rows and 2 columns (L and O). I am doing addition of these 2 columns in column P. Further I want to count the occurrence in this column if addition is EQUAL to 2 or 4 or 6 or 8 BUT condition here is that The COUNT should be such that BOTH the columns L and O are EQUAL and Their addition is either 2 or 4 or 6 or 8.
This means that only the columns in L and O with values "1+1" , "2+2", "3+3", "4+4" should be counted. The addition of "1+3", "4+2" should not be counted.
=COUNTIF(P:P,4)
does not work.
L O P M
===========================
1 1 2 1 (NO OF 2'S)
2 2 4 1 (NO OF 4'S)
3 3 6 1 (NO OF 6'S)
1 3 4* NO TO BE COUNTED
4 4 8 1 (NO OF 8'S)
2 4 6* NOT TO BE COUNTED
4 2 6*
AS SEEN ABOVE RESULT OF COUNTING IS STORED IN M. Let me know the formula
=IF(L29=M29,SUMPRODUCT(--($L$29:$L$35=$M$29:$M$35)*(L29=$L$29:$L$35)),"Not Counted")
My data started in row 29 so you will need to adjust the references. It counts the entire table in 1 shot. So if you added a row to the bottom that had 1 and 1 and 2, the results in column M in your first row would become 2 and the same for the row you just added.
Will this formula help...?
=IF(AND(A1=B1,OR(SUM(A1,B1)=2,SUM(A1,B1)=4,SUM(A1,B1)=6,SUM(A1,B1)=8)),SUM(A1,B1),"NOT TO BE COUNTED")
Just drag the formula till you have data. You will need to adjust the references.
Here is the reference data.

Microsoft Excel Finding Position Based on two column data?

Fail Count Total Number Position
0 666 3
1 555 5
0 777 1
2 444 7
1 888 4
2 655 6
3 566 9
3 780 8
0 700 2
Position column is result that I need automatically by function (any combination of builtin function or custom function). Logic here is the minimum value of column (Fail count) and maximum value of column (Total Number) will first position. And minimum value of column (Fail count) and second maximum value of column (Total Number) will second position. It will continue till end data of column A and B.
How about simply sorting you data: Order by Fail Count ascending and, if equal Fail Count, by Total Number descending?
With a formula this becomes an array formula with very bad performance.
Formula in D2downwards:
{=MATCH(B2*10^(MAX($A$2:$A$1000)-A2),LARGE($B$2:$B$1000*10^(MAX($A$2:$A$1000)-$A$2:$A$1000),ROW($A$2:$A$1000)-ROW($A$1)),0)}
This is an array formula. Input it into the cell without the curly brackets and press [Ctrl]+[Shift]+[Enter] to finish.

What is wrong with formula: =IF(A1>B4:D4,1,0)?

Question 1
What is wrong with formula?
=IF(A1>B4:D4,1,0)
I want if cell A1 is greater than set of cells (B4:D4) then it returns 1.
Answered
Question 2:
How can i select/indentify two MAX values from set of cells? I want to count two max values.
For example:
(header) A B C D E
(row1) 1 5 4 1 3
It should return
(header) F G H I J
(row1) 0 1 1 0 0
For top 2 values I would use the LARGE function
=IF(A1>LARGE(B4:D4,2),1,0)
The LARGE function returns the nth largest value, so LARGE(B4:D4,1) would be equivalent to MAX(B4:D4), but LARGE(B4:D4,2) returns the 2nd largest value
I guess you mean bigger than the max of them:
=IF(A1>MAX(B4:D4),1,0)

Resources