What's the difference between UNICODE() and CODE()?

Cubist

Well-known Member
Joined
Oct 5, 2023
Messages
806
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I want to know the difference between the two functions UNICODE() and CODE(). Based on their Microsoft documentations,

UNICODE(): "This article describes the formula syntax and usage of the UNICODE function in Microsoft Excel."
CODE(): "Returns a numeric code for the first character in a text string. The returned code corresponds to the character set used by your computer."

Similarly CHAR() vs. UNICHAR(). I'm trying to understand the use case preferences between the two. Thanks.
 
I've always used UNICODE(). I just learned about the existence of CODE() today. They both date back to XL2013. It sparked my interest as to the reason why XL offers both. I don't think compatibility is an issue. As far as I can tell there are no cases where CODE() is preferred over UNICODE(). While UNICODE() is a superset of CODE().
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
CODE() is older than EXCEL 2013, UNICODE() was brought into Excel 2013 to greatly extend the character set and so CODE() is backwards compatible for the older versions of Excel, whereas UNICODE is more flexible...
Horses for courses as the saying goes
 
Upvote 0
A little off topic now but how would one find documentation for functions pre-2013?
The best I can find is this page documenting Excel versions going back to Excel 1.0, which I'm tempted to download to see how people used to live, but not the functions.
 
Upvote 0
Techonthenet always seem accurate for a large range of functions (at least back to Excel 2000, not sure about before that), think they currently only go up to Functions that were there when 2019 was current (including the 365 functions at that time) but might be wrong on that

Ellesa at StackExchange Superuser made a spreadsheet with a breakdown for what was available for 2003/2007 and 2010 versions based on MS listings for the individual versions (that I don't think you can into now)
Link to the spreadsheet below

 
Upvote 0

Forum statistics

Threads
1,215,197
Messages
6,123,585
Members
449,108
Latest member
rache47

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