Trying to identify a cell value once the conditions are met

LeanneBG

Board Regular
Joined
Jun 20, 2016
Messages
157
Hi! Im new to VBA so please be kind..
I am currently doing a report wherein I identify what should be the scope (column B) and who should be the action owner (column A) in "data" tab, depending on the conditions. The conditions are in the "Instructions" tab. There a multiple conditions, if the 1st condition isn't met, i will proceed to the 2nd condition, so on and so forth, until i met the condition - so i can identify the owner and scope.

For example, the first condition is = if the document number (column S) in "Data" tab can be looked up in "Raw Data - Infosys In Scope" then the owner will be Indirect CO Owned and scope will be Freeze Items. But if that didn't meet the 1st condition, then i will go to the next condition and so on and forth.

Here's the link to the file: https://www.dropbox.com/s/z1sbnqm62yn9gt9/Working File.xlsx?dl=0

I've already tried below formula but it won't work. Some are returning FALSE instead of the right owner and scope..

=IFERROR(VLOOKUP(S5,'Raw Data - Infosys In Scope'!U:V,2,),IF(OR(LEFT(AI5,7)="HEWLETT",AI5="INFOSYS BPO LTD"),"Infosys / HP Vendor",IF(AND(E5="Logistics",F5<>"CBL"),"Outbound Logistics",IF(AND(F5="CBL",E5<>"Logistics"),"CBL Vendor",IF(AND(OR(LEFT(AI5,7)<>"HEWLETT",AI5<>"INFOSYS BPO LTD"),E5<>"Logistics",F5<>"CBL",OR(LEFT(J5,3)="A6P",LEFT(J5,3)="F6P")),"Direct Items",IF(OR(AND(OR(I5="SAUDI ARABIA",I5="EGYPT",I5="PAKISTAN",I5="DUBAI"),OR(Y5="110",Y5="#-P"),OR(LEFT(J5,3)="F7P",LEFT(J5,3)="A7P"),OR(O5="#",O5="Expense",O5="Storeroom"),OR(D5="Invoice Overdue",AND(D5="Invoice Near Due",C5="Infosys OOSLA"))),(AND(OR(I5="SAUDI ARABIA",I5="EGYPT",I5="PAKISTAN",I5="DUBAI"),H5="Infosys - Governance",OR(D5="Invoice Overdue",AND(D5="Invoice Near Due",C5="Infosys OOSLA")))),(AND(F5<>"CBL",G5="Central Ops"))),"LD - Indirect CO",IF(OR(AND(OR(I5="SAUDI ARABIA",I5="EGYPT",I5="PAKISTAN",I5="DUBAI"),OR(LEFT(J5,3)="F7P",LEFT(J5,3)="A7P"),OR(O5="#",O5="Expense",O5="Storeroom"),OR(AND(D5="Invoice Near Due",D5="Infosys w/ in SLA"),D5="Invoice Not Yet Due"),X5<>"#-Q"),(AND(OR(I5="SAUDI ARABIA",I5="EGYPT",I5="PAKISTAN",I5="DUBAI"),H5="Infosys - Governance",OR(AND(D5="Invoice Near Due",D5="Infosys w/ in SLA"),D5="Invoice Not Yet Due"),X5<>"#-Q"))),"LD - Infosys",IF(AND(OR(I5="SAUDI ARABIA",I5="EGYPT",I5="PAKISTAN",I5="DUBAI"),OR(LEFT(J5,3)="F7P",LEFT(J5,3)="A7P"),OR(O5="#",O5="Expense",O5="Storeroom"),X5="#-Q"),"Language Dependent Market"))))))))
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
With that amount of data in a condition you should really be looking at creating a lookup table.
Unfortunately I don't have time to look at this in any detail
 
Upvote 0
I tried doing that but however it doesn't work. Since i have to follow the conditions in order..
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,825
Members
449,470
Latest member
Subhash Chand

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