Function for reading cell format

M

msbaby

I need to build an IF statement, depending on a cell format, in this case, if
cell background is red or white.

CELL function does not provide any option to read this format attribute.

Before I build a VB function to read Cell Format, can anyone tell me if this
is possible with bult-in Excel functions?
 
J

Jason Morin

You could do it with XLM functions. Press Ctrl+F3 and
define the name "color" (no quotes) as:

=IF(GET.CELL(63,!$A1)=3,"Red",IF(GET.CELL(63,!$A1)
=2,"White"))

Now call it with

=color

on your worksheet. It's set to look at col. A.

HTH
Jason
Atlanta, GA
 
M

msbaby

This is just perfect.

Thank you very much.

Can you just tell me where to find documentation about XLM functions?

Best Regards,
Sandra
Lisboa
Portugal

"Jason Morin" escreveu:
 
G

Gord Dibben

Sandra

Just a few words of caution from a Harlan Grove posting.

*********************************

One caveat with respect to the GET.FORMULA responses. If you're using Excel
2000 or older, copying a cell which in any way references an XLM formula (such
as GET.FORMULA) and trying to paste it into a different worksheet will *KILL*
Excel *IMMEDIATELY* with *COMPLETE* *DATA* *LOSS*!

This has been fixed in Excel XP, but the other repondents should be aware that
not all Excel users have upgraded to Excel XP (or even 2000, or even 97). So
unless the OP has stated *explicitly* that they're using Excel XP, these other
respondents would be wise to remember to mention this caveat. In older
versions of Excel, XLM functions in defined names are like renovating your
home using plastic explosives.

********************************************

Note: where Harlan states Excel 2002/XP, also include 2003.

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top