Get value from a range based on certain conditions

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,214
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
I want to get value from B2:E6 corresponding to A2:A6 which Matches with A10 and also corresponding to the cell value in the column G21:J21 whose value is MINIMUM and NEGATIVE else 0

How to accomplish?
Thanks in advance

10​
111​
222​
333​
444​
20​
100​
200​
300​
400​
30​
1000​
2000
3000​
4000​
40​
10000​
20000​
30000​
40000​
50​
11​
22​
33​
44​
30​
10​
20​
30​
40​
50​
1111​
-22
-11​
555​
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Could you post some more details? I still don't know what exactly you are looking for.

Book1.xlsm
ABCDEFGHIJ
1
210111222333444
320100200300400
4301000200030004000
54010000200003000040000
65011223344
7
8
9
1030
11
12
13
14
1510
1620
1730
1840
1950
20
211111-22-1155
Sheet3


So that's your data.
I don't understand the meaning of row 21 (G21:J21)
 
Upvote 0
Try in B10 (or other cell where you need it):
Excel Formula:
=INDEX(B2:E6,MATCH(A10,A2:A6,0),MATCH(MIN(H21:K21),H21:K21,0))

Whoops that was not including this "negative else 0" part.

So, if I understand it right:
Excel Formula:
=if(MIN(H21:K21)<0,INDEX(B2:E6,MATCH(A10,A2:A6,0),MATCH(MIN(H21:K21),H21:K21,0)),0)
 
Upvote 0
Solution
Try in B10 (or other cell where you need it):
Excel Formula:
=INDEX(B2:E6,MATCH(A10,A2:A6,0),MATCH(MIN(H21:K21),H21:K21,0))

Whoops that was not including this "negative else 0" part.

So, if I understand it right:
Excel Formula:
=if(MIN(H21:K21)<0,INDEX(B2:E6,MATCH(A10,A2:A6,0),MATCH(MIN(H21:K21),H21:K21,0)),0)
Kaper You understood it right. This is what I needed. Thanks Kaper for your efforts, time and help :) :)
 
Upvote 0
Glad to hear it did the job. And thanks for marking my post as a solution.
 
Upvote 0

Forum statistics

Threads
1,215,284
Messages
6,124,067
Members
449,140
Latest member
SheetalDixit

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top