ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i get the mid function to work with a zero (https://www.excelbanter.com/excel-worksheet-functions/92352-how-do-i-get-mid-function-work-zero.html)

garbold

how do i get the mid function to work with a zero
 
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

Marcelo

how do i get the mid function to work with a zero
 
try to format the cell as a text.

regards from Brazil
Marcelo

"garbold" escreveu:

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



how do i get the mid function to work with a zero
 
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.

"garbold" wrote in message
...
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




tony h

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

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


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=548914


tony h

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

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


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=548914


garbold

how do i get the mid function to work with a zero
 
Hi thanks have tried that and now it works thanks again

"Marcelo" wrote:

try to format the cell as a text.

regards from Brazil
Marcelo

"garbold" escreveu:

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


garbold

how do i get the mid function to work with a zero
 
Hi..thanks for the post it now works...thanks anyway

"Andy" wrote:

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.

"garbold" wrote in message
...
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





garbold

how do i get the mid function to work with a zero
 
Thanks tony..alls well now have tried info from ealier posts

regards Gary

"tony h" wrote:


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


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=548914




All times are GMT +1. The time now is 03:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com