Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Michael
 
Posts: n/a
Default Problem with the VALUE function

Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael
  #2   Report Post  
Niek Otten
 
Posts: n/a
Default

Hi Michael,

What you get is the number of days since the year 1, for Feb 1, 5302.

What did you require the formula to return and why?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Michael" wrote in message
...
Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to
originally
identify a data that is a problem because it will return an error when
there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero,
so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if
there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael



  #3   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:
Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael

  #4   Report Post  
Michael
 
Posts: n/a
Default

Hi Roger.

I tried inputting the data as =" '02-5302' ", but it reads it as literally
'02-5302'... I am missing something?

Thanks,

-Michael

"Roger Govier" wrote:

Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:
Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael


  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

Maybe you can force it to not look like a date:

=VALUE("000"&"02-5302")
or
=VALUE("000"&A1)



Michael wrote:

Hi Roger.

I tried inputting the data as =" '02-5302' ", but it reads it as literally
'02-5302'... I am missing something?

Thanks,

-Michael

"Roger Govier" wrote:

Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:
Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael



--

Dave Peterson


  #6   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Michael

I misunderstood what you were trying to do, although my explanation of the
result you are getting is correct.

If you are just checking to make sure there are no "-" entries within a
cell, then you could use

=IF(NOT(ISERROR(FIND("-",A7)0)),"error","ok")

Regards

Roger Govier


Michael wrote:
Hi Roger.

I tried inputting the data as =" '02-5302' ", but it reads it as literally
'02-5302'... I am missing something?

Thanks,

-Michael

"Roger Govier" wrote:


Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:

Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael


  #7   Report Post  
Michael
 
Posts: n/a
Default

Hi Niek.

Here is what I am trying to do. I have two sets of data that I need to
compare. For example, I want to compare 025302 against 02-5302 (it could be
00000025302 or 025302FDHDH there are only a few cases). The first thing I
check is the values. My assumption is that if it returns an error, then there
is some non-number character invloved and I would precede to mark it
accordingly. In the case of 025302 against 02-5302, I would expect
Value(02-5302) to return #Value! error since there is a dash. Then I would
search for certain chars and find out that it has a dash. So this instance
would be marked as having a "dash issue".

My function works on the great majority of the data involved except for the
instances where it is like 01, 02 ... etc because of the date issue you
mentioned. Is there a work around I could do to avoid this issue? Or is
there a way to override the conversion to the date format?

I really appreciate your help.

Thanks,

-Michael

"Niek Otten" wrote:

Hi Michael,

What you get is the number of days since the year 1, for Feb 1, 5302.

What did you require the formula to return and why?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Michael" wrote in message
...
Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to
originally
identify a data that is a problem because it will return an error when
there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero,
so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if
there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael




  #8   Report Post  
Michael
 
Posts: n/a
Default

Hi Roger.

I use that later on when I am trying to find certain issues, but I am using
the value function to initially identify the data that is a problem.

I want to be generic because there can be a plethora of problems like
slashes, alpha chars, and/or special chars. The dash is only one instance of
the problem.

The other issue I have is that I cannot change the data. I can only look at
it and mark whether it has a certain issue.

Sorry, I know this is difficult and confusing (Trust me!), but I really
appreciate your help.

Thanks,

-Michael

"Roger Govier" wrote:

Hi Michael

I misunderstood what you were trying to do, although my explanation of the
result you are getting is correct.

If you are just checking to make sure there are no "-" entries within a
cell, then you could use

=IF(NOT(ISERROR(FIND("-",A7)0)),"error","ok")

Regards

Roger Govier


Michael wrote:
Hi Roger.

I tried inputting the data as =" '02-5302' ", but it reads it as literally
'02-5302'... I am missing something?

Thanks,

-Michael

"Roger Govier" wrote:


Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:

Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael


  #9   Report Post  
Roger Govier
 
Posts: n/a
Default

Hi Michael

I think Dave gave you the answer then, by just adding the "000" in front of
your data.


Regards

Roger Govier


Michael wrote:
Hi Roger.

I use that later on when I am trying to find certain issues, but I am using
the value function to initially identify the data that is a problem.

I want to be generic because there can be a plethora of problems like
slashes, alpha chars, and/or special chars. The dash is only one instance of
the problem.

The other issue I have is that I cannot change the data. I can only look at
it and mark whether it has a certain issue.

Sorry, I know this is difficult and confusing (Trust me!), but I really
appreciate your help.

Thanks,

-Michael

"Roger Govier" wrote:


Hi Michael

I misunderstood what you were trying to do, although my explanation of the
result you are getting is correct.

If you are just checking to make sure there are no "-" entries within a
cell, then you could use

=IF(NOT(ISERROR(FIND("-",A7)0)),"error","ok")

Regards

Roger Govier


Michael wrote:

Hi Roger.

I tried inputting the data as =" '02-5302' ", but it reads it as literally
'02-5302'... I am missing something?

Thanks,

-Michael

"Roger Govier" wrote:



Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:


Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael

  #10   Report Post  
Michael
 
Posts: n/a
Default

Great! It worked!... Thank you so much!

-Michael

"Dave Peterson" wrote:

Maybe you can force it to not look like a date:

=VALUE("000"&"02-5302")
or
=VALUE("000"&A1)



Michael wrote:

Hi Roger.

I tried inputting the data as =" '02-5302' ", but it reads it as literally
'02-5302'... I am missing something?

Thanks,

-Michael

"Roger Govier" wrote:

Hi Michael

The problem is Excel trying to be too helpful!!!
It is seeing 02-5302 as you wanting to enter Feb 5302 (rather a long time
ahead).

It doesn't try to do that with 00, as there cannot be a month 0, but it will
do it with values through 01 to 12, which is why your 020-5302 works.

One way round it would be to warp the value inside single quotes within your
double quotes

=VALUE(" '020-5302' ") (deliberately spaced out to show the single quote)

Regards

Roger Govier


Michael wrote:
Hey guys!

I was wondering if someone can help me. I am trying to parse through two
sets of data in Excel in order to identify certain problems between them.
Problems include additional miscellaneous characters, dashes instead of
zeros, extra zeros in the beginning, etc.

I am writing functions for each case using the VALUE function to originally
identify a data that is a problem because it will return an error when there
is something not right with the string. So, I would check VALUE("00-5220")
which would give an error, hence I know that the data has an issue and can
check from there.

However if I do, VALUE("02-5302"), the result is 1242588 (Which ruins the
whole check I am doing because it will skip it). However, if I add a zero, so
=VALUE("020-5302") the result is an error (Which is what I want).

Can someone explain this to me? I have been playing around with it for a
while now and I cannot figure it out. My observations indicate that if there
is a "0" before the dash, there will be an error as expected. However, any
other number before the dash will return some number.

I greatly appreciate any assistance you could offer.

Thanks,

-Michael


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count function problem nkidd Excel Worksheet Functions 4 July 7th 05 08:55 PM
Lookup function problem (kg) greencecil Excel Worksheet Functions 3 July 1st 05 04:54 PM
Problem with function "Worksheet_Change" konpego Excel Worksheet Functions 0 June 23rd 05 05:46 AM
Problem adding a range using Sumif function. vrk1 Excel Worksheet Functions 2 June 22nd 05 06:05 PM
Need a ISWorkday Function -- Any Ideas Mark Excel Worksheet Functions 5 March 29th 05 01:58 AM


All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"