Please help me to find a formula able to return in a specific cell the 2 last numbers of a bar code only if it starts with a specified string.
Thank you in advance!
Please help me to find a formula able to return in a specific cell the 2 last numbers of a bar code only if it starts with a specified string.
Thank you in advance!
Might be an idea to post some examples ?
Perhaps along the lines of:
=IF(LEFT(barcode;2)="XX";0+RIGHT(barcode;2);"")
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
ex: 1842000102346 1942000102330 2000000102338 1943000102362
1842 represents the name of the product that I am interested in finding its measure, expressed by the last two digits - 46
thanks
So, adapting earlier example, assuming number in A1:
B1: =IF(LEFT(A1;4)="1842";0+RIGHT(A1;2);"")
Thank you for your help.
Unfortunately I couldn't make myself clear.
I need a formula that is able to check each code in a range and to apply your solution for the cell that contains the code which start with 1842.
Thank you again!
That formula does what you want. You put that formula in B1 (or wherever you want in row 1...it checks the value in A1)...then copy the cell down as far you need. The formula will adjust for each row as you copy downward.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
You are right, but I need to use the formula in a single cell.
That cell will complete a form...
Maybe =--RIGHT(INDEX(A1:A100, MATCH("1842", INDEX(LEFT(A1:A100, 4), 0), 0)), 2)
Entia non sunt multiplicanda sine necessitate
Thank you very much for your answer.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks