Column/ Array comparison for first instance where column A less than column B

keatsc

New Member
Joined
Dec 29, 2014
Messages
7
HTML:
Date		Committed		OnHand
28/11/2018	1			11
29/11/2018	3			10
30/11/2018	3			9
01/12/2018	4			8
02/12/2018	2			7
03/12/2018	5			8
04/12/2018	6			10
05/12/2018	8			6
06/12/2018	4			8
07/12/2018	5			5
08/12/2018	6			3
09/12/2018	7			8
Hi there,

I'm trying to compare a list of values in the Committed column against a list of values in the OnHand Column to get a single corresponding date value from the first related row.

I want to return the date value on the row which has the first instance of the value in the Committed Column being higher than the value in the OnHand Column. So the correct answer would be 05/12/2018 but not 08/12/2018 in the example above.

My Index Match formula looks for a set value but I don't know what the value in the column is or would be so that's no use to me. I tried putting in another index match in place of the fixed value but it errored. I tried matching against True but that complained as well.

Any suggestions appreciated. Not sure if I'm even in the right ballpark with my formula attempts. Let me know if more info is required.

Thanks for looking.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
How about

Excel 2013/2016
ABCD
16DateCommittedOnHand
1728/11/201811105/12/2018
1829/11/2018310
1930/11/201839
2001/12/201848
2102/12/201827
2203/12/201858
2304/12/2018610
2405/12/201886
2506/12/201848
2607/12/201855
2708/12/201863
2809/12/201878
Archive
Cell Formulas
RangeFormula
D17{=INDEX(A17:A28,MATCH(1,--(B17:B28>C17:C28),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
That works perfectly thank you. Can you check my understanding below is correct?

{=INDEX(A17:A28,MATCH(1,--(B17:B28>C17:C28),0))}

After the Match, "1" is the value matched against so is that related to an array of something like 0,0,1,0 for column B greater than column C and the "0" at the end is the first instance of 1 in that array?

What are the "--" for?

Thanks for your help.
 
Upvote 0
This part
(B17:B28>C17:C28)
will return
FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;TRUE;FALSE
the -- then converts that to
0;0;0;0;0;0;0;1;0;0;1;0
Then the
MATCH(1,
is specifying that we want to find 1 in the above array
and the 0 at the end is saying it needs to be an exact match.

HTH
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,657
Members
449,462
Latest member
Chislobog

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