# Need help with AND OR Functions



## zarealshook (Jan 2, 2023)

Hi there, 

      I am working on combining IF with AND OR functions but so far I have been unable to figure out what went wrong. 

      I need to do the followings:

      If the PO type is Local, then designate the "PO Lateness" column based on the "PO Duration" cell value if it matches the days criteria given in table. The same thing applies if the PO type is Overseas. 

      Any help would very much be appreciated. 

       Here below what I have tried so far:


----------



## Skybluekid (Jan 2, 2023)

Hi

This may be a solution for you




The below formula is in Cell C2





Hope this helps


----------



## jdellasala (Jan 2, 2023)

Try this instead.
Table: *Local*
Book1EF1DaysLateness20Optimum33Optimum410Early515Late616FailSheet3
Table: *Overseas*
Book1HI1DaysLateness20Optimum330Optimum460Early590Late691FailSheet3
Table: *Actuals*
Book1ABC1PO TypePO DurationPO Lateness2Local55Fail3Overseas161Fail4Local197Fail5Local415Fail6Overseas179Fail7Overseas270Fail8Local1Optimum9Local3Optimum10Local10Early11Local11Early12Local14Early13Local15Late14Local16Fail15Overseas1Optimum16Overseas30Optimum17Overseas31Optimum18Overseas60Early19Overseas89Early20Overseas90Late21Overseas91FailSheet3Cell FormulasRangeFormulaC2:C21C2=IF([@[PO Type]]="Local",VLOOKUP([@[PO Duration]],Local,2), VLOOKUP([@[PO Duration]],Overseas,2))Cells with Data ValidationCellAllowCriteriaA2:A17ListLocal, Overseas
I used Data Validation for *PO Type* to prevent data entry errors.
It would be helpful if you updated your profile to indicate what version of Excel you're using and for what OS, and when posting data, please use *XL2BB*.


----------



## zarealshook (Jan 2, 2023)

Skybluekid said:


> Hi
> 
> This may be a solution for you
> View attachment 81867
> ...


Thanks heaps, Skybluekid. It worked like a charm! Can't thank you enough. 

 Best Regards,


----------



## Skybluekid (Jan 2, 2023)

zarealshook said:


> Thanks heaps, Skybluekid. It worked like a charm! Can't thank you enough.
> 
> Best Regards,


You are very welcome


----------



## zarealshook (Jan 2, 2023)

jdellasala said:


> Try this instead.
> Table: *Local*
> Book1EF1DaysLateness20Optimum33Optimum410Early515Late616FailSheet3
> Table: *Overseas*
> ...


Hi jdellasala, 

   Appreciated your input. Your solution is really helpful and worked perfectly. You simplified it in a very helpful way. 

   PS: I have updated my profile as per your kind advice. Thanks! 

    Regards,


----------



## Peter_SSs (Jan 2, 2023)

@Skybluekid
I suggest that you update your signature as these things are no longer relevant in the current forum environment.





Perhaps you could update to give information about XL2BB instead?


----------



## jdellasala (Jan 2, 2023)

zarealshook said:


> Hi jdellasala,
> 
> Appreciated your input. Your solution is really helpful and worked perfectly. You simplified it in a very helpful way.
> 
> ...


Thanks. Glad it helped!


----------



## Skybluekid (Jan 2, 2023)

@Peter_SSs 

I have tried to use XL2BB but it does not seem to work. I am using 365.  All it does is disable the macros.  Any suggestions?


----------



## Peter_SSs (Jan 2, 2023)

Skybluekid said:


> I have tried to use XL2BB but it does not seem to work. I am using 365.  All it does is disable the macros.  Any suggestions?


Have a look here (& other threads in the About This Board forum if this is not the exact issue)
Thanks for removing that obsolete information from your signature.


----------



## zarealshook (Jan 2, 2023)

Hi there, 

      I am working on combining IF with AND OR functions but so far I have been unable to figure out what went wrong. 

      I need to do the followings:

      If the PO type is Local, then designate the "PO Lateness" column based on the "PO Duration" cell value if it matches the days criteria given in table. The same thing applies if the PO type is Overseas. 

      Any help would very much be appreciated. 

       Here below what I have tried so far:


----------



## Skybluekid (Jan 3, 2023)

Peter_SSs said:


> Have a look here (& other threads in the About This Board forum if this is not the exact issue)
> Thanks for removing that obsolete information from your signature.


Thank you all sorted.


----------



## Peter_SSs (Jan 3, 2023)




----------

