understanding dash dash in a excel formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have come across a function I do not understand.
1.
Input
Thursday, October 27, 2005 8:59:09 AM

Formula
=(--RIGHT(B2,LEN(B2) - (FIND(",",B2)+1)))

Result (this is the result I wanted)
10/27/05 8:59 AM

2.
Input
Thursday, October 27, 2005 8:59:09 AM

Formula
=(RIGHT(B3,LEN(B3) - (FIND(",",B3)+1)))

Result ( this is not the result i wanted)
October 27, 2005 8:59:09 AM

Why does putting "--" before "RIGHT" give me the desired result?
 
The double dash is just a way to convert string to number. The differences
you see may be just formatting. the value should be:

38652.3744097222

to account for the 9 seconds.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top