Nested If Statement + Index/Match with multiple criteria

lpost1214

New Member
Joined
Nov 9, 2016
Messages
6
I am trying to populate an open order report with next production dates since our system does not peg production to orders. I am trying write a formula that will meet multiple criteria, but can't seem to get the formula to work just right. Below is a sample of the data and below that the production data and the formula I've written.

Formula:
IFERROR(IF(OR(VALUE(g4) > 0,A4=" "),"",IF(AND(VALUE(g4)=0,a3="Description"),VLOOKUP(B4,Sched!A:C,3,0),IF(B4=" ","",IF(AND(VALUE(g4)=0,VALUE(g3) <> 0),INDEX(Sched!C:C,MATCH(Detail!B4,Sched!A:A,0)),IF(AND(VALUE(g4)=0,VALUE(g3)=0,VLOOKUP(B4,Sched!A:C,3,0)-h3 < h4),INDEX(Sched!C:C,MATCH(Detail!B4,Sched!A:A,0)+1),INDEX(Sched!C:C,MATCH(Detail!B4,Sched!A:A,0))))))),"-")

<tbody>
</tbody><colgroup><col span="38"></colgroup>


Criteria:
*If value in balance on hand (column G) = 0, and first row for item (column A) then look up first production quantity for that item.
*If value in balance on hand (column G) = 0, and not first row for item (column A), check to see if production quantity looked up in row above minus the open order qty for the line above, >= open order quantity in the current row. If true, then return the same production quantity as above, if false, return next production quantity for that item.
*If there is no look up value once criteria is met, return a 0
*If an empty row or the value in column G is >0, then show as blank

Thanks in advance for your help!
DescriptionCust PO #Del DateCustomer PO QuantityShipped QtyOpen Order QtyBalance On Hand Next Production Qty
<colgroup><col width="180" style="width: 135pt; mso-width-source: userset; mso-width-alt: 6582;"> <col width="107" style="width: 80pt; mso-width-source: userset; mso-width-alt: 3913;"> <col width="87" style="width: 65pt; mso-width-source: userset; mso-width-alt: 3181;"> <col width="64" style="width: 48pt; mso-width-source: userset; mso-width-alt: 2340;"> <col width="55" style="width: 41pt; mso-width-source: userset; mso-width-alt: 2011;"> <col width="65" style="width: 49pt; mso-width-source: userset; mso-width-alt: 2377;"> <col width="121" style="width: 91pt; mso-width-source: userset; mso-width-alt: 4425;"> <col width="126" style="width: 95pt; mso-width-source: userset; mso-width-alt: 4608;"> <tbody> </tbody>
AS Ultra Trop HBRC 8/3/5021713378284/20/201854170541705472
AS Ultra Trop HBRC 8/3/5021713693796/4/201854170541705472
-
AS Trop HBG RC 8/3/82ct21713289494/9/201847500475048
AS Trop HBG RC 8/3/82ct21713693826/11/201814250142501440
-
Citracal GEL 12/2/70ct21712648477/6/201825000250001
Citracal GEL 12/2/70ct21713077168/10/201812500125006788
-
AS HB GEL 8/3/36ct21712592182/9/20184106041063883
AS HB GEL 8/3/36ct21713076073/12/20182542025421341
AS HB GEL 8/3/36ct21713324694/11/2018254202542011400
-
AS HB GEL 8/3/60ct21712592192/9/201829330293302934
AS HB GEL 8/3/60ct21713076063/9/201814670146701
-
AS HB PM GEL 8/3/46ct21713485933/26/20183750037503838
AS HB PM GEL 8/3/46ct21713485944/26/201837500375088
AS HB PM GEL 8/3/46ct21713527285/11/201837500375003750
AS HB PM GEL 8/3/46ct21713755206/15/201837500375003750
-
AS HB PM GEL 8/3/24ct21713667886/1/201820830208303126
AS HB PM GEL 8/3/24ct21713755196/15/201810420104203126
-
AS Trop HBG RC 8/3/68ct21713521785/24/201841670416704210
-
AS HB RC Frt 8/3/75ct21713621815/24/201841670416704210
<colgroup><col width="180" style="width: 135pt; mso-width-source: userset; mso-width-alt: 6582;"> <col width="107" style="width: 80pt; mso-width-source: userset; mso-width-alt: 3913;"> <col width="87" style="width: 65pt; mso-width-source: userset; mso-width-alt: 3181;"> <col width="64" style="width: 48pt; mso-width-source: userset; mso-width-alt: 2340;"> <col width="55" style="width: 41pt; mso-width-source: userset; mso-width-alt: 2011;"> <col width="65" style="width: 49pt; mso-width-source: userset; mso-width-alt: 2377;"> <col width="121" style="width: 91pt; mso-width-source: userset; mso-width-alt: 4425;"> <col width="126" style="width: 95pt; mso-width-source: userset; mso-width-alt: 4608;"> <tbody> </tbody>


Part DescriptionDue DateProduction Quantity
AS HB GEL 8/3/36ct5/11/201811400
AS HB GEL 8/3/36ct6/1/20181
AS HB GEL 8/3/60ct5/18/20182934
AS HB GEL 8/3/60ct6/1/20181
AS HB PM GEL 8/3/24ct5/4/20183126
AS HB PM GEL 8/3/46ct4/20/20183750
AS HB PM GEL 8/3/46ct5/18/20183750
AS HB PM GEL 8/3/46ct6/7/20186250
AS HB RC Frt 8/3/75ct5/11/20184210
AS Trop HBG RC 8/3/68ct4/6/20184210
AS Trop HBG RC 8/3/82ct5/4/20181440
AS Trop HBG RC 8/3/82ct5/25/20181920
AS Trop HBG RC 8/3/82ct6/15/20181440
AS Ultra Trop HBRC 8/3/504/6/20185472
AS Ultra Trop HBRC 8/3/505/4/20185472
Citracal GEL 12/2/70ct6/8/20181
<colgroup><col width="209" style="width: 157pt; mso-width-source: userset; mso-width-alt: 7643;"> <col width="113" style="width: 85pt; mso-width-source: userset; mso-width-alt: 4132;"> <col width="162" style="width: 122pt; mso-width-source: userset; mso-width-alt: 5924;"> <tbody> </tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,588
Messages
6,120,409
Members
448,959
Latest member
camelliaCase

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