HomeGoogle DocsSpreadsheetHow to Use the Function N in Google Sheets

How to Use the Function N in Google Sheets [Practical Use]

Published on

The function N in Google Sheets is not so popular. I was also not sure about the usefulness of this function. But quite recently I’ve found that this function is quite useful to sort out some formula problems.

In this Google Sheets tutorial, you can learn the use of Google Sheets N function. Let me introduce you the syntax, some basic examples and then the real use of this function.

How to Use the Function N in Google Sheets

The function N returns the provided argument as a number. Let me start with the syntax first.

The N Function Syntax

N(value)

If you feed any value to N, no matter whether it’s a number, text, Boolean True/False or even a tick box, the function converts it to a number. See the below few examples to understand this.

Basic Examples of Google Sheets N function

The below example shows how the N function responds to different arguments.

Google Sheets N function Examples

Let me start with the formula in Cell E2. The N function converts the date entry in Cell D2 to the equivalent date value. If you check the other formulas you can see that the numbers are returned as same numbers, the text is converted as numeric value 1, the Boolean True is 1 and the False is 0. The Boolean part is applicable to the Tick Boxes also.

The Practical Use of Google Sheets N Function [N Function in Complex Formulas]

The function N in Google Sheets can also take an array as the reference. For example, I can enter an Array formula in cell E2 (please refer the above screenshot) instead of entering several non-array formulas in the range E2: E10.

=ArrayFormula(N(D2:D10))

This feature we can intelligently use in formulas using MMULT where the blank cells in any of the two arrays cause an error.

In such cases, we can first fill all the blank cells with the value 0 by using the function N in Google Sheets. Here is that example.

How to Fill Blank Cells With the Value Zero in Google Sheets?

Fill Blank Cells With the Value Zero

See the values in the range in C1: E4 where the Cells D2 and E3 are blanks. The N formula in G1 fill those blank cells with the value 0.

If you are an advanced Google Sheets user, here is one example that shows how to use the function N in MMULT in Google Sheets.

Google Sheets N Function in MMULT to Avoid #VALUE! Error

See one normal MMULT formula example.

In this example, I’ve entered one formula in the Cell G8 which is as follows.

=mmult(transpose(F3:F6),G3:I6)

It multiplies the rate column (F) with Column G, Column H and Column I. I’m not going into that details.

Now just delete any of the values in the range G3: I6. No surprise, the MMULT formula would return an error. To avoid that you can wrap the range G3: I6 with the N formula as below.

=ArrayFormula(mmult(transpose(F3:F6),N(G3:I6)))

When using the function N in a range, do apply ArrayFormula. Hope this makes clear.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.