vlookup if 1st condition is met

chickey

New Member
Joined
Jun 15, 2015
Messages
7
I am trying to get the next job number using vlookup once the first requirement is met.

I am using an If and vlookup statemnt

if((qty*-1)< net, vlookup customer part number,customer part number:Job number,2,false),0)

once this requirement is met i want it to find the next job number.</SPAN>


Customer Part Number
qty
NET
Job Number
Part Number
Job Number
S50372-000
16
-4
197203-001
S50372-003
197126-001
S50372-000
16
-9
197203-001
S50372-000
197203-001
S50372-000
16
-11
197203-001
S50433-001
197348-001
S50372-000
16
-14
197203-001
S50433-002
197349-001
S50372-000
16
-21
197516-001
S50433-000
197508-001
S50372-000
16
-26
197516-001
S50372-000
197516-001
S50372-000
16
-31
197516-001
S50433-001
197596-001
S50372-000
16
-52
197516-001
S50433-002
197609-001
S50372-000
16
-95
197516-001
S50372-000
197688-001
S50372-000
16
-31
197516-001
S50421-004
197722-001
S50372-000
16
-31
197516-001
S50433-001
197771-001
S50372-000
16
-31
197516-001
S50372-000
16
-31
197516-001
S50372-000
16
-31
197516-001

<TBODY>
</TBODY>
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi Chickey,

Give this a try. I changed up your data a little bit for testing:


Excel 2010
ABCDEFG
1Customer Part NumberqtyNETJob NumberPart NumberJob Number
2S50372-00016-4197203-001S50372-003197126-001
3S50372-00016-9197516-001S50372-000197203-001
4S50372-00016-11197688-001S50433-001197348-001
5S50372-00016-14S50433-002197349-001
6S50372-00016-21S50433-000197508-001
7S50433-00216-5197349-001S50372-000197516-001
8S50433-002164197609-001S50433-001197596-001
9S50372-00016-52S50433-002197609-001
10S50372-00016-95S50372-000197688-001
11S50372-00016-31S50421-004197722-001
12S50372-00016-31S50433-001197771-001
13S50372-00016-31
14S50372-00016-31
15S50421-004165197722-001
Sheet1
Cell Formulas
RangeFormula
D2{=IFERROR(INDEX($G$2:$G$12,SMALL(IF($F$2:$F$12=A2,ROW($G$2:$G$12)-ROW($G$2)+1),IF(AND($A2<>$A1,(B2*-1)),1,IF(AND((B2*-1)),ROW($A2)+1-MATCH($A2,$A$1:$A$15,0),""))),1),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.


Best,

Luke
 
Upvote 0
good Morning Luke,

Thanks for the formula, I just have one question. what do i need to chnge? Based on the results I should not be gettin the next job number until "c" is greater than "b*-1" on the first part nuber i should not get a different result until line 6. thanks in advance for your help.

Craig
 
Upvote 0
Hi, thanks for the great question.

I think you are saying that there should be a result in line 5. There isn't because there are only 3 instances of S50372-000 in Column F. If Line 5 should have a value, what would it be?
 
Upvote 0
Craig,

Based on your samples and information so far

=IFERROR(INDEX($H$2:$H$12,SMALL(IF($G$2:$G$12=A2,(ROW($G$2:$G$12)-ROW($G$2))+1),IF(B2>ABS(C2),1,2))),"")

Array confirmed with Shift Ctrl Enter.

Note that this does only cover the first 2 job numbers in the list as you asked, at what point, if any, should the result move to the 3rd job number, then 4th, etc?
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,844
Members
449,051
Latest member
excelquestion515

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