Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Determining a Value of a Cell.

Determining a Value of a Cell

by Allen Wyatt
(last updated November 28, 2016)

4

You already know that a cell in a worksheet can contain any number of different items: numbers, dates, formulas, and so on. There may be times when you want to determine the underlying value in a cell, without regard to the way the cell is formatted. For this need, Excel provides the N worksheet function. For instance, let's assume that cell F17 contains a date. If you use = N(F17) as your formula, the value returned by the formula is the underlying serial number used for the date.

Besides returning date serial numbers, the N worksheet function returns a number if the referenced value or cell can be resolved to a number, a 1 if the value or cell can be resolved to the logical value True, and a 0 for anything else. The following provides a few examples of how the N worksheet function works:

Value in F17 Returned by = N(F17)
3/11/99 36230
37.14 37.14
TRUE 1
Quarter 1 0
5:40 0.236111

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11552) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Determining a Value of a Cell.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Templates and Page Setup

Templates are a great way to share styles, macros, and other settings among various documents. One thing that isn't shared ...

Discover More

Dealing with Oily Skin

Does your skin feel greasy to the touch and are you having problems getting just the right look with your facial makeup? It ...

Discover More

Word 2013 Styles and Templates (Table of Contents)

Styles are at the heart of Word's formatting power. Understanding how to use styles can greatly increase your ability to ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Median of Selected Numbers

Need to find a median value in a series of values? It's easy with the MEDIAN function. What isn't as easy is to derive the ...

Discover More

Finding the Nth Root of a Number

Finding a square root is easy because Excel provides a worksheet function for that purpose. Finding a different root may not ...

Discover More

Determining Columns in a Range

If you need to know the number of columns in a particular range, you can use the COLUMNS worksheet function. This tip ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 1?

2016-11-29 10:27:48

Christian

@Stephen: first tip is great! I will use it now to comment my formulas.


2016-11-28 16:54:25

Stephen Barrett

Hi Allen

Greetings from New Zealand, I trust you are well.

There's a couple of other uses for the N function, which I discovered by accident:

1. It can be added at the end of any formula to store a useful comment.
eg =SUM(A1:A365)+N("all 2016 sales")

Because N("any text string") has a value of 0, it doesn't alter the SUM, but allows the comment to remain with the formula. I find this easier than the more intrusive Comment feature, and is an alternative to Named Ranges/Formulae.

2. As a security feature, of sorts.
eg =NetProfit/N(A1), where NetProfit is a named range, and cell A1 contains nothing, or some innocuous text, but allows the above formula to display the value of NetProfit when the value 1 is entered, almost like a password.

Before this, the formula will yield #DIV/0! and will appear to be an error, whereas it is a deliberate result until 'the password' is entered.

One variation of this is using a multiplier or divisor in the cell that N refers to, to deliberately disguise or alter results.

This is made even more obtuse by changing the text colour of the 'password cell' to white, so the password - the argument of N - can be hidden in plain view.

These approaches will baffle many people because many people are unaware of the existence of N. Of course, someone whose middle name is Sherlock will trace this quite quickly, but it's not for them ;)

Shalom


2016-11-28 11:04:08

John

3/11/99, 37.14, TRUE and 5:40 could all be strings that only appear to be numbers, in which case the N function would return 0. Similarly, Quarter 1 could be a number formatted to appear as a string.


2016-11-28 07:29:31

Ken Varley

When using date examples, you should use a date that is not ambiguous.

In this tip, you give an example date of 3/11/99

Anyone in America reading this date will see it as 11th March

Anyone in England reading the date will read it as 3rd November

I appreciate that in this example it doesn't really matter, but if you used a date that was higher than 12th of the month (eg 15th), it would simplify the example by removing ambiguity


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.