I have attached a partial of a file with the columns I'm having an issues with. On the worksheet you will find two sections:
This worksheet generates new codes for a product.
First is the data section the second is the Lookup table that I am using, this is a sample data but represents the format.
The data section is a copy of data only, no formulas or lookup to the lookup table, I do have questions on the excel sheet of what I hope explains what I am trying to do.
Column A is the primary column and where I enter the code manually, column "B" & "C" are the new codes that will be generated combining columns, First letter from column "A", column "I" and column "H". Other columns are for quick reference and reporting.
Column E is all characters to the left of the first "-".
The #N/A in rows 4&5, columns "E" & "F" is because these rows don't have an entry in column "G".
Really need help on getting column "E" and "G", but any and all suggestions would be appreciated.
Not very clear about your column G.
You should show us what formulas you are using and what are your expected answers in case of #N/A.
It is very difficult for us to guess.
Anyway, give this a try.
Cell B2 : =LEFT(A2,1)&I2&H2
Cell E2 : =IFERROR(LEFT(A2,FIND("-",A2)-1),A2)
Cell F2 : =VLOOKUP(G2,Table1,3,FALSE)
Cell G2 : =IFERROR(MID(A2,FIND("-",A2)+1,99),"CONV")
Cell H2 : =VLOOKUP(G2,Table1,4,FALSE)
Good luck.
Sunny
FWIW, you could simplify E2 to:
=LEFT(A2,FIND("-",A2&"-")-1)
Thank you Sunny and Velouria.
Here are my formulas:
Cell B2 =LEFT([@[RT Line Code]],1)&[@[Auto Incremtal ]]&[@[Trait_ID]]
Cell E2 =IF([@[Trait_Family_Code]]="X",[@[RT Line Code]],LEFT(A3, FIND("-", A3)-1))
Cell F2 =XLOOKUP([@[Trait_Family]],Trait_ID[Trait],Trait_ID[Trait_Family_Code])
Cell G2 is a manual entry at this time, will try your suggestions and let you know.
Cell H2 =XLOOKUP(G3,Trait_ID[Trait],Trait_ID[Trait_ID])
All formulas you have shared work great, thank you very much.
Now my only issue is how do I auto increment column "I", it being an alphanumeric entry and then when it gets to AA99, it advances to BA01 and starts the count over. This might just stay a manually entered cell.
I thank you again for the help.
What happens if you get to ZA99?
Well, good question, on present additions x 2 to the file, that will take about 50 years, I hopefully wouldn't have to worry about it by then.
That is why I'm might not work about doing it, but it would be fun to try and find out how to do it.
Hi Doug
If your data is in an Excel Table, then you can give this a try.
In cell I2 enter :
=IFERROR(IF(MID(I1,3,2)<>"99",LEFT(I1,2)&VALUE(MID(I1,3,2))+1,CHAR(CODE(LEFT(I1,1))+1)&"A"&1),"AA1")
As you add new row, the formula will auto fill downwards.
You can try change the 99 to maybe 5 or 10 just to check if the increment is OK.
Hope this helps.
Sunny