I have a workbook with 3 worksheets:
I need a formula in WS1, column C, that does the following:
IF A2 does NOT contain 836600, steps 2 and 3 are still followed, but the lookup is on WS3 instead.
Below are examples of each WS, along with what the results in column C SHOULD be.
WS1:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Department[/TD]
[TD]Vendor[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]836600[/TD]
[TD]PRICE CONSTR CO., INC[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]836600[/TD]
[TD]SOUTHERN EQUIP CO INC[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]835512[/TD]
[TD]SOUTHERN ROPE WORKS[/TD]
[TD]NA[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]836600[/TD]
[TD]SOUTHERN EQUIPMENT COMPANY[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]836600[/TD]
[TD]PRICE CONSTRUCTION COMPANY[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]827600[/TD]
[TD]KINTECH[/TD]
[TD]Kintech[/TD]
[/TR]
</tbody>[/TABLE]
WS2 (for 836600 lookup):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Vendor[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Southern Equip[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Price Const[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Southern Rope[/TD]
[TD]SRW[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]ABC Type[/TD]
[TD]ABC[/TD]
[/TR]
</tbody>[/TABLE]
WS3 (for NON-836600 lookup):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Vendor[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]John Jones Taxi Service[/TD]
[TD]JJ Taxi[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]ABC Type[/TD]
[TD]ABC[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Southern Equip[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]KINTECH[/TD]
[TD]Kintech[/TD]
[/TR]
</tbody>[/TABLE]
The other half of this problem is this: the lookup can't be based on the same number of characters that column B begins with. For instance, with Southern Equipment and Southern Rope, I need it to look at least 10 characters from the beginning (to differentiate between the two), but it can't look that far for Kintech, since it's only 7 characters long to begin with.
I currently have something like:
=IF(LEFT(B2,13)="SOUTHERN ROPE","SRW",IF(LEFT(B2,5)="PRICE","PRICE",IF(LEFT(B2,5)="ABC T","ABC"
with an IF statement for each of my companies (less than 20) but this doesn't include the lookup on the two separate worksheets. I tried to use the wildcard (=if(B2="SOUTHERN R*") but couldn't get it to work.
Bottom line, I'm trying to apply a consistent identifier to each company, regardless of how it's listed. i.e., John Doe, Co., Inc. and John Doe Enterprises and John Doe, LLC would all get the identifier of John Doe.
One change I CAN make, if it helps, is to combine WS2 and WS3 adding a column for Department number, so the lookup has to find the rows matching the department number (836600 or otherwise) on WS2 first, then continue as above.
I know this is a lot, but I'm trying to give as clear a picture as I can. Any help would be greatly appreciated!!
- WS1 has 3 columns (A,B&C). Column A contains a set of numbers and column B contains text, both beginning in Row 2. (Column C needs the formula I'm having trouble writing.)
- WS2 contains 2 columns of text (A&B), both beginning in Row 2.
- WS3 contains 2 columns of text (A&B), both beginning in Row 2.
I need a formula in WS1, column C, that does the following:
- Determine if cell A2 contains the number 836600;
- If it does, look in WS2 column A and find a cell that begins with same 6-8 characters that are in WS1, column B;
- If found, return data in column B of WS2; if not found, return "Misc"
IF A2 does NOT contain 836600, steps 2 and 3 are still followed, but the lookup is on WS3 instead.
Below are examples of each WS, along with what the results in column C SHOULD be.
WS1:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Department[/TD]
[TD]Vendor[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]836600[/TD]
[TD]PRICE CONSTR CO., INC[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]836600[/TD]
[TD]SOUTHERN EQUIP CO INC[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]835512[/TD]
[TD]SOUTHERN ROPE WORKS[/TD]
[TD]NA[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]836600[/TD]
[TD]SOUTHERN EQUIPMENT COMPANY[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]836600[/TD]
[TD]PRICE CONSTRUCTION COMPANY[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]827600[/TD]
[TD]KINTECH[/TD]
[TD]Kintech[/TD]
[/TR]
</tbody>[/TABLE]
WS2 (for 836600 lookup):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Vendor[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Southern Equip[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Price Const[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Southern Rope[/TD]
[TD]SRW[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]ABC Type[/TD]
[TD]ABC[/TD]
[/TR]
</tbody>[/TABLE]
WS3 (for NON-836600 lookup):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Vendor[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]John Jones Taxi Service[/TD]
[TD]JJ Taxi[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]ABC Type[/TD]
[TD]ABC[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Southern Equip[/TD]
[TD]SEC[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]KINTECH[/TD]
[TD]Kintech[/TD]
[/TR]
</tbody>[/TABLE]
The other half of this problem is this: the lookup can't be based on the same number of characters that column B begins with. For instance, with Southern Equipment and Southern Rope, I need it to look at least 10 characters from the beginning (to differentiate between the two), but it can't look that far for Kintech, since it's only 7 characters long to begin with.
I currently have something like:
=IF(LEFT(B2,13)="SOUTHERN ROPE","SRW",IF(LEFT(B2,5)="PRICE","PRICE",IF(LEFT(B2,5)="ABC T","ABC"
with an IF statement for each of my companies (less than 20) but this doesn't include the lookup on the two separate worksheets. I tried to use the wildcard (=if(B2="SOUTHERN R*") but couldn't get it to work.
Bottom line, I'm trying to apply a consistent identifier to each company, regardless of how it's listed. i.e., John Doe, Co., Inc. and John Doe Enterprises and John Doe, LLC would all get the identifier of John Doe.
One change I CAN make, if it helps, is to combine WS2 and WS3 adding a column for Department number, so the lookup has to find the rows matching the department number (836600 or otherwise) on WS2 first, then continue as above.
I know this is a lot, but I'm trying to give as clear a picture as I can. Any help would be greatly appreciated!!