Home > Articles > Home & Office Computing > Microsoft Applications

Exploring Excel's Functions Part 3: CELL() Shocked

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Close Window

Peter Aitken 

Learn more…

Debugging 101 for Visual Studio
Sep 15, 2006
Fun with Fractals in Visual Studio .NET
Aug 11, 2006
Exploring Excel Functions, Part 9: Analyzing Frequency Distributions
Aug 4, 2006
File Management in .NET
Jul 7, 2006
Exploring Excel Functions 8: Predicting the Future
Jun 30, 2006
Exploring Excel's Functions, Part 7: Rounding with Excel
Jun 23, 2006
Binary File Access in the .NET Framework
Jun 16, 2006
Text File Access in the .NET Framework
Jun 2, 2006
Using Geometric Transforms for Text Effects in .NET
May 26, 2006
Understanding MDI Applications in .NET
May 12, 2006
A .NET Framework Text and Font Primer
Apr 21, 2006
Exploring Excel's Functions, Part 6: TTEST() Function
Apr 14, 2006
Troubleshooting Excel PivotTables
Apr 7, 2006
Troubleshooting Word Tables
Mar 31, 2006
Exploring Excel's Functions, Part 5: The Power of Choice
Mar 24, 2006
Seven Things I Hate About Word Printing
Mar 10, 2006
Exploring Excel's Functions, Part 4: Database Functions
Feb 24, 2006
Exploring Excel's Functions Part 3: CELL() Shocked
Feb 3, 2006
Exploring Excel's Functions Part 2: ADDRESS() and INDIRECT()
Dec 30, 2005
Exploring Excel's Functions: IF() Only!
Dec 9, 2005
Advanced Find-and-Replace Tools in Word
Oct 28, 2005
Going Beyond Basic Spaces and Hyphens in Word
Sep 16, 2005
Get Organized with Word's Outline Tools
Aug 19, 2005
Managing Your Money in Microsoft Excel: Basic Financial Calculations
Jul 29, 2005
Structured Exception Handling in Visual Studio .NET
Oct 8, 2004
Multithreading with the .NET Framework
Jun 11, 2004
.NET Tools for Working with XML
May 21, 2004
Storing Information: Variables and Constants in C
Mar 28, 2003
Introducing Web Programming with .NET
Mar 1, 2002
Using Web Forms
Mar 1, 2002
Introducing Web Services
Feb 15, 2002
XML and the .NET Framework
Feb 8, 2002
ASP.NET Programming: Using Web Forms
Jan 25, 2002
Understanding the Common Features of Web Controls
Aug 20, 2001

Sorry, this author hasn't posted any blogs.

You might guess that the CELL() function has something to do with worksheet cells, but exactly what does it do? This often-overlooked function is one of Excel's information functions, so-called because their jobs are to provide information about certain aspects of the worksheet. In this third article in a series on Excel's advanced functions, Peter Aitken shows you how to take advantage of the CELL() function's capabilities to make your workbooks stand out in terms of usability and convenience.

You might guess that the CELL() function has something to do with worksheet cells—but exactly what? It is one of Excel’s information functions, so-called because their job is to provide information about certain aspects of the worksheet.

A Hard Cell

The CELL() function can tell you a lot of things about a specified worksheet cell. It needs two pieces of information to work, and the syntax is as follows:

CELL(info_type, reference)

Reference tells the function which cell you are interested in. It can be a cell address or range name. If reference refers to a range of more than one cells, CELL() returns information about the top-left cell in the range.

Info_type is a text value that tells the function what information you want. The following table gives all the possibilities. Some of them will be explained in more detail later in the article.

Value of Info_type

Information Returned by CELL()

"address"

The address of the cell as an absolute cell reference (for example, $A$2).

"col"

The column number of the cell.

"color"

1 if the cell is formatted to display negative values in color; 0 otherwise.

"contents"

The contents of the cell. If the cell contains a formula, the result is returned, not the formula itself.

"filename"

The filename, including path, and sheet name where the cell is located. The workbook must have been saved for this option to work.

"format"

A text value indicating the number format applied to the cell. For example, "G" is returned for General format, and "D3" for the mmm-yy date format. See Excel help for a complete listing of return values.

"parentheses"

1 if the cell is formatted with parentheses for positive or all values; 0 otherwise.

"prefix"

Text value corresponding to the label alignment prefix of the cell. Returns a single quotation mark (’) if the cell contains left-aligned text, double quotation mark (") if the cell contains right-aligned text, caret (^) if the cell contains centered text, backslash (\) if the cell contains fill-aligned text, and empty text ("") if the cell contains anything else.

"protect"

1 if the cell is locked; 0 if it is not locked

"row"

The row number of the cell.

"type"

Text value indicating the type of data in the cell. Returns "b" if the cell is empty, "l" if the cell contains text, and "v" for anything else (numbers, formulas, and so on).

"width"

The width of the cell, rounded to an integer, expressed as number of characters in the default font size.

You can see that the CELL() function is quite flexible, but is there anything really useful you can use it for? Oh yes! Let’s look at some specific examples.

  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Did You Know 4.0
By John Traenkenschuh on August 14, 2010 No Comments

There's an old video on You Tube that purports to be a true indicator of massive world changes.  What do you think of it?

Emily NaveCommunity Tips: Starting a User Group Library
By Emily Nave on August 3, 20102 Comments

The Central Penn Adobe User Group (CPAUG) uses a library program to share books from different publishers with members. A short Q&A with group leader Megan Fister provides some great tips for starting your own.

Emily NaveUser Group Organizations: Finding Support in the Greater IT Community
By Emily Nave on July 29, 20102 Comments

Birds of a feather flock together, right? If you’re already a member of an established user group or looking for other like-minded technology evangelists, connecting with peers is an important part of being an active voice in the IT community.

See All Related Blogs

Informit Network