#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default Formula required

Hi all, using excel 2007

I would like a formula to test a column to find out whether
the cells in the column are either a constant, a formula, or
a name that has been defined.

In A1 Putting the formula and filling down as many as required.
Something like:
=IF( B1 is a constant, "constant",IF( B1 is a name,"name", "formula"))

Is that possible in a formula or will the problem only be solved
with a macro?

Regards Skinman.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Formula required

Try this small UDF:

Public Function typeeOf(r As Range) As String
Dim f As String, n As Name
Application.Volatile
f = r.Formula
If Left(f, 1) < "=" Then
typeeOf = "constant"
Exit Function
End If
f = Right(f, Len(f) - 1)
For Each n In ActiveWorkbook.Names
If n.Name = f Then
typeeOf = "name"
Exit Function
End If
Next
typeeOf = "formula"
End Function

--
Gary''s Student - gsnu200904


"Skinman" wrote:

Hi all, using excel 2007

I would like a formula to test a column to find out whether
the cells in the column are either a constant, a formula, or
a name that has been defined.

In A1 Putting the formula and filling down as many as required.
Something like:
=IF( B1 is a constant, "constant",IF( B1 is a name,"name", "formula"))

Is that possible in a formula or will the problem only be solved
with a macro?

Regards Skinman.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula required. sherbrooke[_2_] Excel Discussion (Misc queries) 22 January 26th 09 07:21 PM
Help with a formula required please Dave Excel Discussion (Misc queries) 3 November 2nd 07 12:07 PM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Formula help required!!! CADmanJP Excel Worksheet Functions 2 March 10th 06 03:45 AM
A Formula required - please! Anthony Excel Discussion (Misc queries) 2 July 21st 05 10:11 AM


All times are GMT +1. The time now is 07:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"