Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I test a cell's formula (ex: Is this cell and Avg or a sum?

I want to be able to test the formula for a cell to see if it is an Average
or a Sum.

EX: ( if the first 4 characters of the forumula for A:3 = "=AVG", then B:3 =
"Average")

If not, can I designate cells by color. Then test for all cells that are a
certain color...

EX: (if Color of A:3 is red, then B:3 equals "Average")




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default How do I test a cell's formula (ex: Is this cell and Avg or a sum?

One way:

-Select Cell B1.
-Choose Insert/Name/Define
-Enter in 'Names in workbook:" box:

FormulaToLeft

-Enter in 'Refers to:' box:

=Get.Formula(A1)

-Click Add, OK

-in cell b3, enter:

=IF(ISERR(FIND("AVERAGE(",FormulaToLeft)),"","Aver age")

Or, to differentiate between AVERAGE and SUM:
=IF(ISERR(FIND("AVERAGE",FormulaToLeft)),
IF(ISERR(FIND("SUM(",FormulaToLeft)), "Neither","SUM"), "Average")

NOTE: Copying worksheets with references to XL4M commands (such as
Get.Formula()) to a new workbook will crash MacXL and Pre-WinXL03
applications.



In article ,
Karie wrote:

I want to be able to test the formula for a cell to see if it is an Average
or a Sum.

EX: ( if the first 4 characters of the forumula for A:3 = "=AVG", then B:3 =
"Average")

If not, can I designate cells by color. Then test for all cells that are a
certain color...

EX: (if Color of A:3 is red, then B:3 equals "Average")

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
How do I enter a formula in a cell that changes per another cell's Bev Greene Excel Worksheet Functions 5 November 10th 06 03:48 PM
Returning a cell's formula in a different cell T.R. Young Excel Worksheet Functions 2 February 16th 06 06:41 PM
IF Function to test formula in a cell Fred Holmes Excel Worksheet Functions 5 November 18th 05 12:04 AM
Is there a logical test for a cell's format instead of contents Bruce Excel Worksheet Functions 3 November 17th 05 01:40 AM
Test a cell for a formula present Trebor Retrac Excel Discussion (Misc queries) 1 May 30th 05 05:11 PM


All times are GMT +1. The time now is 06:04 PM.

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

About Us

"It's about Microsoft Excel"