Note: The other languages of the website are Google-translated. Back to English

Excel TOROW function

The TOROW function transforms an array or range to a single row.

Note: This function is only available in Excel for Microsoft 365 on the Insider channel.

TOROW function VS. TOCOL function

The TOROW function can be used to transform an array or a range to a single row, while the TOCOL function can be used to transform an array or a range to a single column.

Syntax

=TOROW(array, [ignore], [scan_by_column])

Arguments

Array (required): An array you want to transform to a single row.
Ignore (optional): To ignore certain types of values. By default, all values are kept.
-- 0 or omitted: Keep all values (default);
-- 1: Ignore blanks;
-- 2: Ignore errors;
-- 3: Ignore blanks and errors.
Scan_by_column (optional): How the function scans the array.
-- FALSE or omitted: The array is scanned by row (default);
-- TRUE: The array is scanned by column.

Return value

It returns a single row.

Example

Here we take the table below as an example to demonstrate the different uses of the TOROW function.

#Example1: Transform a range to a single row and keep all values by default

The range above contains both blanks and error values. To transform the range to a single row and keep all values in the resulting row, please apply the following formula.

Select a cell, such as B11 in this case, enter the following formula and press the Enter key to get the new row.

=TOROW(B6:D8)

Notes:

1) In this case, we omitted the Ignore and the scan_by_column arguments in the formula.
2) Blank cells are displayed as 0s in the resulting row.
#Example2: Transform a range to a single row and ignore certain types of values

To ignore all blanks, you just need to specify a number 1 for the ignore argument. The formula is as follows.

=TOROW(B6:D8,1)

To ignore error values, specify the number 2 for the ignore argument. The formula is as follows.

=TOROW(B6:D8,2)

To ignore both the blanks and errors, specify a number 3 for the ignore argument.

=TOROW(B6:D8,3)

#Example3: Transform a range to a single row by scanning values by column

By default, the TOROW function scans the array by rows. If you need to return a single row from the array scanned by column, you need to set the scan_by_column argument to TRUE.

Select a cell, say J6 in this case, enter the following formula and press the Enter key to get the new row.

=TOROW(B6:D8,3,TRUE)


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL