#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Why does this work?

I got this formula from Max, Singapo =VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
I would like to know how the +0 is working in this. I've spent about alot of
time in Help and on the internet trying to find out, but I think you guys are
the ones that can clear it up. I know it's making the formala recognize the
concatenation as a number, but how?
Thanks and have...
--
OneFineDay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Why does this work?

=A1&B1
concatenates two strings.

So if A1 contained 1 and B1 contained 23, the
=A1&B1
would result in the string 123

By adding 0 to the string, excel will coerce the string value to a real number
123.

If you put
=A1&B1
in C1
and
=(A1&B1)+0
in D1

You can see the difference with formulas like:
=isnumber(c1)
=isnumber(d1)
and
=istext(c1)
=istext(d1)


M Thompson wrote:

I got this formula from Max, Singapo =VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
I would like to know how the +0 is working in this. I've spent about alot of
time in Help and on the internet trying to find out, but I think you guys are
the ones that can clear it up. I know it's making the formala recognize the
concatenation as a number, but how?
Thanks and have...
--
OneFineDay


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 634
Default Why does this work?

Just to add to Dave's reply, any mathematical operation on a piece of text
that can be interpreted as numeric, will coerce it to a numeric.

Same answer can be obtained with:

=VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
=VLOOKUP((A1&B1)*1,Sheet2!A1:C6,3,0)
=VLOOKUP(--(A1&B1),Sheet2!A1:C6,3,0)

Regards
Ken..................



"M Thompson" wrote in message
...
I got this formula from Max, Singapo
=VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
I would like to know how the +0 is working in this. I've spent about alot
of
time in Help and on the internet trying to find out, but I think you guys
are
the ones that can clear it up. I know it's making the formala recognize
the
concatenation as a number, but how?
Thanks and have...
--
OneFineDay



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Why does this work?

Hi Dave
Thanks for the explanation. It will be a definite help for the future.
P.S. This is the second try at replying to your answer. I keep getting a
temporarily out of service notice, so let's hope you get this one!

Have..
--
OneFineDay


"Dave Peterson" wrote:

=A1&B1
concatenates two strings.

So if A1 contained 1 and B1 contained 23, the
=A1&B1
would result in the string 123

By adding 0 to the string, excel will coerce the string value to a real number
123.

If you put
=A1&B1
in C1
and
=(A1&B1)+0
in D1

You can see the difference with formulas like:
=isnumber(c1)
=isnumber(d1)
and
=istext(c1)
=istext(d1)


M Thompson wrote:

I got this formula from Max, Singapo =VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
I would like to know how the +0 is working in this. I've spent about alot of
time in Help and on the internet trying to find out, but I think you guys are
the ones that can clear it up. I know it's making the formala recognize the
concatenation as a number, but how?
Thanks and have...
--
OneFineDay


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Why does this work?

Ken-Thanks for adding to the info. Every big bit helps!

Have..
--
OneFineDay


"Ken Wright" wrote:

Just to add to Dave's reply, any mathematical operation on a piece of text
that can be interpreted as numeric, will coerce it to a numeric.

Same answer can be obtained with:

=VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
=VLOOKUP((A1&B1)*1,Sheet2!A1:C6,3,0)
=VLOOKUP(--(A1&B1),Sheet2!A1:C6,3,0)

Regards
Ken..................



"M Thompson" wrote in message
...
I got this formula from Max, Singapo
=VLOOKUP((A1&B1)+0,Sheet2!A1:C6,3,0)
I would like to know how the +0 is working in this. I've spent about alot
of
time in Help and on the internet trying to find out, but I think you guys
are
the ones that can clear it up. I know it's making the formala recognize
the
concatenation as a number, but how?
Thanks and have...
--
OneFineDay




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
need a function that will work using multiple work books and sheet capt c Excel Worksheet Functions 1 March 30th 09 10:20 PM
extracting totals from 1 work sheet to another work work sheet cj Excel Discussion (Misc queries) 2 October 27th 07 10:54 PM
Counting dates in multiple work sheets and work books Savage Excel Discussion (Misc queries) 0 December 19th 05 11:41 PM
Is there away to keep "auto save" from jumping to the first work sheet in the work book? Marc New Users to Excel 2 April 21st 05 01:27 AM
Spin button in a work sheet - how do I make it work? [email protected] Excel Worksheet Functions 1 April 7th 05 08:43 PM


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

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

About Us

"It's about Microsoft Excel"