# Thread: Need some help Thanks: 0 Likes: 0

1. ## Need some help

Hi!

I need help with my excel worksheet.

If I write XXXX in column A - YYYY will appear in column b.
Is that possible?

2. ## Re: Need some help

put =if(A1="XXXX","YYYY","") in B1 and copy down

3. ## Re: Need some help

Originally Posted by AlanY
put =if(A1="XXXX","YYYY","") in B1 and copy down

Hmm, sorry that won't work.

We have 17 workorder number which is connected to 17 PO numbers.

(WO 1901 - PO 0101
1902 - 0102
1903 - 0103 etc etc)

So if I write WO number "1901" in column A - PO Number "0101" will be written in column b. Would save alot of time!

4. ## Re: Need some help

ok, try vlookup() with a table like this

ABCDE
119050105WOPO
219010101
319020102
419030103
519040104
619050105
719060106
819070107
919080108
1019090109
1119100110
1219110111
1319120112
1419130113
1519140114
1619150115
1719160116
1819170117

Sheet1

Worksheet Formulas
CellFormula
B1=VLOOKUP(A1,\$D\$2:\$E\$18,2,FALSE)

5. ## Re: Need some help

or just ="01"&RIGHT(A1,2) in B1 might work

6. ## Re: Need some help

Originally Posted by AlanY
ok, try vlookup() with a table like this

A B C D E
1 1905 0105 WO PO
2 1901 0101
3 1902 0102
4 1903 0103
5 1904 0104
6 1905 0105
7 1906 0106
8 1907 0107
9 1908 0108
10 1909 0109
11 1910 0110
12 1911 0111
13 1912 0112
14 1913 0113
15 1914 0114
16 1915 0115
17 1916 0116
18 1917 0117
Sheet1

Worksheet Formulas
Cell Formula
B1 =VLOOKUP(A1,\$D\$2:\$E\$18,2,FALSE)
Thank you, this did the work.
Is it possible to extend the script to lookup from another sheet? Im creating new WO with unique number that is also connected to PO numbers.

Example: WO: 19301 - 0107
19409 - 0117

7. ## Re: Need some help

Couldn't delete my previous post, but here's an better explanation. I hope

9. ## Re: Need some help

in that case, its better to define the table as range then it can be put anywhere in the wookbook.

table now defined as =Sheet4!\$A\$1:\$B\$18

AB
119050105
219170117

Sheet1

Worksheet Formulas
CellFormula
B1=VLOOKUP(A1,Table,2,FALSE)

Workbook Defined Names
NameRefers To
Table=Sheet4!\$A\$1:\$B\$18

AB
1WOPO
219010101
319020102
419030103
519040104
619050105
719060106
819070107
919080108
1019090109
1119100110
1219110111
1319120112
1419130113
1519140114
1619150115
1719160116
1819170117

Sheet4