Index/Match to Return next Match if Criteria is met

lpost1214

New Member
Joined
Nov 9, 2016
Messages
6
I am working on a report to return a value if criteria is met. I've filled in the table below for the Next Production Qty and Next Production Date that i'd like to see populated, I just need help with a formula to help me do this since there are 20-30 items per customer and dozens of customers. The idea is to pull a production date from the production data into column H in the Order Data if there is a 0 in the Balance On Hand after Order Qty/Column E. The value pulled will be dependent on a math equation, so in the first example I've pulled the first production date for that item, then the next cell, H6 would need to evaluate (g5-(c5-e4))<0, if true, pull the next match in the production data, if false pull the same match.
if there is no match show a 0. In the actual data set there will be a blank line between different items, so i'd also need to build in a way to start over where A# = "".

Thank you in advance!


[TABLE="width: 907"]
<tbody>[TR]
[TD="width: 170, bgcolor: transparent"][/TD]
[TD="width: 170, bgcolor: transparent"][/TD]
[TD="width: 87, bgcolor: transparent"][/TD]
[TD="width: 74, bgcolor: transparent"][/TD]
[TD="width: 82, bgcolor: transparent"][/TD]
[TD="width: 105, bgcolor: transparent"][/TD]
[TD="width: 91, bgcolor: transparent"][/TD]
[TD="width: 82, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"][/TD]
[TD="width: 178, bgcolor: transparent"][/TD]
[TD="width: 69, bgcolor: transparent"][/TD]
[TD="width: 100, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 170, bgcolor: transparent"][/TD]
[TD="width: 170, bgcolor: transparent"]Order Data
[/TD]
[TD="width: 87, bgcolor: transparent"][/TD]
[TD="width: 74, bgcolor: transparent"][/TD]
[TD="width: 82, bgcolor: transparent"][/TD]
[TD="width: 105, bgcolor: transparent"][/TD]
[TD="width: 91, bgcolor: transparent"][/TD]
[TD="width: 82, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"][/TD]
[TD="width: 178, bgcolor: transparent"]Production Data
[/TD]
[TD="width: 69, bgcolor: transparent"][/TD]
[TD="width: 100, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: #DDEBF7"]A[/TD]
[TD="bgcolor: #DDEBF7"]B[/TD]
[TD="bgcolor: #DDEBF7"]C[/TD]
[/TR]
[TR]
[TD="width: 170, bgcolor: #1F4E78"][/TD]
[TD="width: 170, bgcolor: #1F4E78"]Item
[/TD]
[TD="width: 87, bgcolor: #1F4E78"]Delivery Date
[/TD]
[TD="width: 74, bgcolor: #1F4E78"]Open Order Qty
[/TD]
[TD="width: 82, bgcolor: #1F4E78"]On Hand Qty
[/TD]
[TD="width: 105, bgcolor: #1F4E78"]Balance from On Hand After Order Qty
[/TD]
[TD="width: 91, bgcolor: #1F4E78"]Next Production Qty
[/TD]
[TD="width: 82, bgcolor: #1F4E78"]Next Production Date
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: #DDEBF7"]Part Description
[/TD]
[TD="bgcolor: #DDEBF7"]Production Date
[/TD]
[TD="bgcolor: #DDEBF7"]Production Qty
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]1
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]3/22/2018
[/TD]
[TD="bgcolor: transparent"]410
[/TD]
[TD="bgcolor: transparent"]31763
[/TD]
[TD="bgcolor: transparent"]31353
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]1[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent, align: right"]4/27/2018
[/TD]
[TD="bgcolor: transparent, align: right"]20160
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]2
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]4/27/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]21273
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]2[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent, align: right"]5/25/2018
[/TD]
[TD="bgcolor: transparent, align: right"]10080
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]3
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]5/31/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]11193
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]3[/TD]
[TD="bgcolor: transparent"]60000000045568





[/TD]
[TD="bgcolor: transparent, align: right"]4/27/2018




[/TD]
[TD="bgcolor: transparent, align: right"]9936



[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]6/6/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]1113
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]5
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]7/6/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]0
[/TD]
[TD="bgcolor: transparent"]20160
[/TD]
[TD="bgcolor: transparent"]4/27/2018
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]6
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]7/13/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]0
[/TD]
[TD="bgcolor: transparent"]20160
[/TD]
[TD="bgcolor: transparent"]4/27/2018
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]7/31/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]0
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"]5/25/2018
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]749115E
[/TD]
[TD="bgcolor: transparent"]8/14/2018
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]0
[/TD]
[TD="bgcolor: transparent"]10080
[/TD]
[TD="bgcolor: transparent"]6/22/2018
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[TD="bgcolor: transparent, align: right"]
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]9
[/TD]
[TD="bgcolor: transparent"]60000000045568
[/TD]
[TD="bgcolor: transparent"]4/27/2018
[/TD]
[TD="bgcolor: transparent"]4968
[/TD]
[TD="bgcolor: transparent"]6184
[/TD]
[TD="bgcolor: transparent"]4618
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]10
[/TD]
[TD="bgcolor: transparent"]60000000045568
[/TD]
[TD="bgcolor: transparent"]5/15/2018
[/TD]
[TD="bgcolor: transparent"]4968
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]0
[/TD]
[TD="bgcolor: transparent"]9936
[/TD]
[TD="bgcolor: transparent"]4/28/2018
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]11
[/TD]
[TD="bgcolor: transparent"]60000000045568
[/TD]
[TD="bgcolor: transparent"]5/17/2018
[/TD]
[TD="bgcolor: transparent"]4968
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]0
[/TD]
[TD="bgcolor: transparent"]9936
[/TD]
[TD="bgcolor: transparent"]4/28/2018
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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