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

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

Related

Rank like Subtotals

It's possible use Rank like Subtotals, that only use de showing data?.
If I filter data by a column, I want than Rank function only use these datas
Example
A B C The column C its Rank of column B
a 5 3
b 9 1
a 2 4
c 7 2
Now if I apply a filter in column A for value 'a'
A B C I want the rank recalculate with this new data
a 5 1 --> column C change from value 3 to value 1
a 2 2 --> column C change from value 4 to value 2
Thanks
You cannot do it by using RANK() formula, but you can create customizable rank formula. For this, You should add column at the and of table to indicate the row visibility, and put this formula into this column:
=(AGGREGATE(3;5;B2)>0)+0
Then put this formula into column C:
=SUMPRODUCT(($B$2:$B$9<B2)*($E$2:$E$9=1))+1
To check real example, download my sample file

Increment value in Excel column depending on existing values in other column

I have 4 columns in Excel: A, B, C, and D. I want two of the columns (C & D) to auto-populate based on the input in the other two columns (A & B). The first column that auto-populates (C) should start at 1 and increment each time a new value is added in the same row of column B. Column D should also start at 1 and increment each time a new value is added in the same row of column B, however, if column A has the same value as the previous row (i.e., a date) then it should not increment but instead be the same value as column D in the previous row. Additionally, if a value in column B is repeated, but with a different value (i.e., a date) in column A, then it's corresponding value in column C should be the same as before, but the value in column D should still increment because the value in column A is new.
To visualize:
A B C D
Jan. 5 red 1 1
Jan. 5 gre 2 1
Jan. 6 pin 3 2
Jan. 6 pur 4 2
Jan. 7 bla 5 3
Jan. 7 blu 6 3
Jan. 8 red 1 4
Jan. 8 gre 2 4
Jan. 9 yel 7 5
Jan. 9 ora 8 5
I hope this makes sense. Any help would be greatly appreciated!
Assuming "A" is in cell A1, hardcode 1 in C2 and D2 then in C3 and downwards:
=iferror(index($C$2:$C2,match(B3,$B$2:$B2,0)),max($C$2:$C2)+1)
and in D3 and downwards:
=if(A3="","",if(A3=A2,D2,max($D$2:D2)+1))

Compare 2 column values and insert value from 3rd to 4th

I reviewed the other post similar to this, but I can't get the formula to work.
In this example, I need to compare values in column I to values in column O, and if they match, insert value from column P into column K.
Thanks in advance!
I K O P
1 SKU Quantity SKU 2 Quantity
2 00866149 31819 21
3 00866246 00866149 24
4 009016018771 00866246 27
5 009016018788 01140606 6
here is the formula:
=INDEX(P:P,MATCH(I:I,O:O,0))
you can read more on it here

Excel Find Value next to max value

If I do a simple formula such as
=MAX(J:J)
and I have a table such as
1 2
2 10
3 45
4 1
5 144
I would expect to see my cell = 144
is there a way for me to get the result 5 (as in the column to the left of the max?)
So if you want the value from column I try this formula
=INDEX(I:I,MATCH(MAX(J:J),J:J,0))
MATCH finds the relevant row number then INDEX gives you the value in column I from that same row

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