IF with nested AND and OR statements

tycasey17

Board Regular
Joined
Sep 26, 2013
Messages
93
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
NameRankID#CodeStatusGenderIssueORD DTCoatPantsSkirtSS ShirtLS Shirt
Doe, JohnSGT12345TTTPUMale30xs26s14.513.5 x 32/33
Doe, JanePV267890AATPUFemale2015-1-18WR8WR8WR8R8R

<tbody>
</tbody>






ISSUE Column needs to have one of the six possible entries:

NI = No Issue, is their rank is an officer then they won't get any issue or if their status is anything but TPU then they won't get anything;

NS = Need Sizes, if they meet the first requirement then of being enlisted and/or a TPU then if the Coat through LS Shirt cell are empty then I want the return to be NS

NTO = Need To Order, if the sizes are all in the cells and there is nothing in the ORD DT cell then I want the return to be NTO;

OO = On Order, if the sizes are all in the cells and a date is entered in the ORD DT then I want the return to be OO

PI = Partial Issue, this is for some stuff that has been given to the individual but not all of it. This is where my hang up is really coming into play. Because the for the males SS Shirt it is just a number and when I input if something has come in a I put he quantity, since the quantity will never be higher than 2 I tried doing a statement to only do equal to or greater than three but it didn't work. I tried using a numeric system but I am trying not to have my formulas be linked to an outside cells besides the ones providing direct data.

FQI = Full Quantity Issued, this is when all items that were ordered have come in and been received by the individual. The sum of this cell will always be 5. based on the cells for the above the numbers will correlate, for males it will be 1+2+0+1+1 (0 since they won't get a skirt) and females will be, 1+1+1+1+1.


I am wanting to have this determined by Male and Female and I have a sample of the formula I used on another section but the clothing is unisex and the sizes where all letter based and not alpha numeric like this is.

SAMPLE FORMULA FROM THE OTHER PAGE. It works just like I needed it to.
=IF($A3="","",
IF(OR(ISNUMBER(MATCH($B3,_OFF,0)),ISNUMBER(MATCH($E3,_NI,0))),"NI",
IF(AND(G3=0,ISBLANK(H3),ISBLANK(I3),ISBLANK(J3),ISBLANK(K3),ISBLANK(L3)),"NS",
IF(AND(G3=0,COUNTIF(H3:L3,"?*")=5),"NTO",
IF(AND(G3<>0,COUNTIF(H3:L3,"?*")=5),"OO",
IF(AND(G3<>0,COUNTIF(H3:L3,"?*")<=4,SUM(H3:L3)<=6),"PI",
IF(AND(G3<>0,SUM(H3:L3)=7),"FQI",
)))))))


If anyone would be able to assist I would appreciate the help. I would give you a sample of what I have done already except I am trying mostly to work on the PI argument to get that one figured out since that is the biggest hang up for me.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I got it figured out. If anyone wants to still post a formula feel free.
 
Upvote 0
Hi tycasey

Glad your issue has been solved.

Just as a tip, if you are checking ISBLANK(H3),ISBLANK(I3),ISBLANK(J3),ISBLANK(K3),ISBLANK(L3) you can instead check IF(LEN(H3&I3&J3&K3&L3)=0) - this might save you some time at some point.

Also, ISBLANK() will return FALSE for a cell that contains a formula, even if the formula returns an empty string, "". If you want the check to instead check if the cell looks blank, LEN()=0 of this will return TRUE.

Mackers
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,839
Members
449,193
Latest member
MikeVol

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