IF Statement

jarett

Board Regular
Joined
Apr 12, 2021
Messages
179
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am trying to have two logical test in my IF statement and running into a mind block. I've got the first thought process working where if two columns are <= give result, but I also want to check another column D if it is > column F produce blank value. So in my example on line 360 the value in column H OrderQty should be blank because column D is greater than column F even though my first statement is true. The other cells that produced results in OrderQty are correct.

Reorder_pts.xlsx
ABCDEFGH
1ItemCodeQuantityOnHandQuantityOnSalesOrderQuantityOnPurchaseOrderReorderPointQtyMinimumOrderQtyLastPhysicalCountDateOrderQty
325CVFRD7GY-2XL REG1011262024####################### 
326CVFRD7GY-2XL TAL97121212####################### 
327CVFRD7GY-3XL REG19801212####################### 
328CVFRD7GY-3XL TAL155121212####################### 
329CVFRD7GY-4XL REG2010612####################### 
330CVFRD7GY-4XL TAL2220612####################### 
331CVFRD7GY-5XL REG071366####################### 
332CVFRD7KH-MED REG101121212#######################12
333CVFRD7KH-MED TAL1300612####################### 
334CVFRD7KH-SM REG140036####################### 
335CVFRD7KH-XL REG91012127/7/202312
336CVFRD7KH-XL TAL3800612####################### 
337CVFRD7NY-2XL REG24402024####################### 
338CVFRD7NY-2XL TAL17201212####################### 
339CVFRD7NY-3XL REG15301212####################### 
340CVFRD7NY-3XL TAL21001212####################### 
341CVFRD7NY-4XL REG2200612####################### 
342CVFRD7NY-4XL TAL3100612####################### 
343CVFRD7NY-5XL REG150066####################### 
344CVFRD7NY-LAR REG67262024#######################24
TEST_REORDER
Cell Formulas
RangeFormula
H325:H344H325=IF([@QuantityOnSalesOrder]+[@QuantityOnHand]<= [@ReorderPointQty],[@MinimumOrderQty],IF([@QuantityOnPurchaseOrder]>=[@MinimumOrderQty],"",""))
 
unless the qty on PO is greater than the minorderqty line 360 falls under this scenario, therefore needed the result in H to be blank.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
OK - I think I have it. You need to check the QtyOrdered>QtyOrderMin first, then test what is OnHand,QtySold see formula below. Please test and let me know.

GetLastRow.xlsm
ABCDEFGH
12CVFRD7GY-4XL TAL2220612####################### 
13CVFRD7GY-5XL REG071366####################### 
14CVFRD7KH-MED REG101121212#######################12
15CVFRD7KH-MED TAL1300612####################### 
16CVFRD7KH-SM REG140036####################### 
17CVFRD7KH-XL REG91012127/7/202312
18CVFRD7KH-XL TAL3800612####################### 
19CVFRD7NY-2XL REG24402024####################### 
20CVFRD7NY-2XL TAL17201212####################### 
21CVFRD7NY-3XL REG15301212####################### 
22CVFRD7NY-3XL TAL21001212####################### 
23CVFRD7NY-4XL REG2200612####################### 
24CVFRD7NY-4XL TAL3100612####################### 
25CVFRD7NY-5XL REG150066####################### 
26CVFRD7NY-LAR REG67262024####################### 
Sheet3
Cell Formulas
RangeFormula
H12:H26H12=IF([@QuantityOnPurchaseOrder]>[@MinimumOrderQty],"",IF([@QuantityOnSalesOrder]+[@QuantityOnHand] <= [@ReorderPointQty],[@MinimumOrderQty], ""))
I made one change which I think gave me the correct results. =IF([@QuantityOnPurchaseOrder]>[@MinimumOrderQty],"",IF([@QuantityOnHand]-[@QuantityOnSalesOrder] <= [@ReorderPointQty],[@MinimumOrderQty], "")). The version you had was leaving off lines that were below the reorder point when you take the qty sold already out of the on hand. Geez a lot of what if for this one.
Reorder_pts.xlsx
ABCDEFGH
1ItemCodeQuantityOnHandQuantityOnSalesOrderQuantityOnPurchaseOrderReorderPointQtyMinimumOrderQtyLastPhysicalCountDateOrderQty
410006961-BROWN-10D7206126/22/202312
1610006961-BROWN-15D000126/22/20232
1710006961-BROWN-15EE000126/22/20232
3210012251-BEIGE/KHAKI-LGR5137036406/22/202340
3410012251-BEIGE/KHAKI-MEDR188036366/22/202336
TEST_REORDER
Cell Formulas
RangeFormula
H4,H16:H17,H32,H34H4=IF([@QuantityOnPurchaseOrder]>[@MinimumOrderQty],"",IF([@QuantityOnHand]-[@QuantityOnSalesOrder] <= [@ReorderPointQty],[@MinimumOrderQty], ""))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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