issue with Match formula

Eurekaonide

Active Member
Joined
Feb 1, 2010
Messages
422
Dear All
I have a formula in one cell which is doing this, =8260&RIGHT(F6,6) and returns say this as a result 8260159860 then next to it I have a formula stating =MATCH(X6,'sheet1'!C:C,0) but it returns an error - if I manually type in the number 8260159860 it returns a figure correctly - I have checked that all the formats are number and tried it on general too Ive checked for any spaces or funny characters but I just cant see why it would do this. I also tried doing and =(The cellB4) to try and reformat etc and this doesn't work either any ideas what is going wrong please? Many thanks as always
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
It appears that Col_C on Sheet1 contains numbers and your concatenation formula returns text.
Try either of these approaches:
Code:
=--(8260&RIGHT(F6,6))
or
Code:
=MATCH(--X6,Sheet1!C:C,0)

The double-minus coerces numeric text into numbers.
You could also: Add zero or multiply by 1, but the double-minus has only one purpose...to convert numeric text to numerics.

Does that help?
 
Upvote 0
When you're combining strings (RIGHT is a text function and returns a string) to other strings or numbers you'll always end up with a string. The easiest way to convert strings to numbers would be using the double negative.

If you want to check it out yourself type 8260159860 into a cell (A1) and your formula into another one (B1). Then check if A1=B1. Excel says they're not. Next check if A1=--B1 and you should get TRUE.
 
Upvote 0

Forum statistics

Threads
1,215,217
Messages
6,123,673
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top