how do i get the mid function to work with a zero

G

garbold

Hi all

I am trying to extract numbers from a test string using the MID function,all
is well until the text string starts with a zero.This is then ignored and
uses the next available number.It is for a barcode generator so the zero is
required.

thanks
 
M

Marcelo

try to format the cell as a text.

regards from Brazil
Marcelo

"garbold" escreveu:
 
G

Guest

Hi
It works for me! It may be that the string is not text, but is a number with
a custom format to show the required number of digits.

Hope this helps.
 
T

tony h

There is not enough detail to determine what is going wrong. Can you
post the formulae or code that you are using.

My guess is that you have a number in a cell which is formatted 000000
(or however many zeros) rather than a text string. This is one way that
would give the results you observe.

If you use =MID(RIGHT("0000"&D1,4),1,1) where the 4 is the length of
the barcode you should be ok. The "0000" needs to be long enough to
cater for the maximum number of leading zeros

regards
 
T

tony h

There is not enough detail to determine what is going wrong. Can you
post the formulae or code that you are using.

My guess is that you have a number in a cell which is formatted 000000
(or however many zeros) rather than a text string. This is one way that
would give the results you observe.

If you use =MID(RIGHT("0000"&D1,4),1,1) where the 4 is the length of
the barcode you should be ok. The "0000" needs to be long enough to
cater for the maximum number of leading zeros

regards
 
Top