PC Review


Reply
Thread Tools Rate Thread

Can I use color of cell in an "If" function?

 
 
George M
Guest
Posts: n/a
 
      1st Sep 2004
Here is what I am attempting to do:

If I have a column of numbers (rows 1 through 50)
rows 3,7,12 are colored yellow.
I want to add up the numbers in only columns 3, 7, and 12 (the cells that
are colored yellow)

Can this be done with a formula?

Thanks
George M


 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      1st Sep 2004
George

If the cells are colored by Conditional Formatting, use that criteria(on) to
SUM the cells.

If not, see Chip Pearson's site for Functions that operate on colored cells.

Gord Dibben Excel MVP

On Wed, 01 Sep 2004 00:02:19 GMT, "George M" <(E-Mail Removed)> wrote:

>Here is what I am attempting to do:
>
>If I have a column of numbers (rows 1 through 50)
>rows 3,7,12 are colored yellow.
>I want to add up the numbers in only columns 3, 7, and 12 (the cells that
>are colored yellow)
>
>Can this be done with a formula?
>
>Thanks
>George M
>


 
Reply With Quote
 
George M
Guest
Posts: n/a
 
      1st Sep 2004
Gord

Thanks for the feedback. I am using fill colors - not conditional. I went to
Chip Pearson's site and studied the series on working with colors. I copied
his scripts and formula, but get nothing but #name? errors.
Don't know what is wrong unless I am using the wrong value for Yellow. I am
trying to search to see if the value is different that what I am using. I am
using 6 because I did read somewhere that Yellow was 6.

I also tried to use Chip's script to get the color of a cell, but get the
same error on that.

By the way, I am using Excel 2003, if that makes a difference.

George M



"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
> George
>
> If the cells are colored by Conditional Formatting, use that criteria(on)

to
> SUM the cells.
>
> If not, see Chip Pearson's site for Functions that operate on colored

cells.
>
> Gord Dibben Excel MVP
>
> On Wed, 01 Sep 2004 00:02:19 GMT, "George M" <(E-Mail Removed)>

wrote:
>
> >Here is what I am attempting to do:
> >
> >If I have a column of numbers (rows 1 through 50)
> >rows 3,7,12 are colored yellow.
> >I want to add up the numbers in only columns 3, 7, and 12 (the cells that
> >are colored yellow)
> >
> >Can this be done with a formula?
> >
> >Thanks
> >George M
> >

>



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      1st Sep 2004
George

The #NAME error usually means that Excel does not recognise the Function.

I assume you copied the User Defined Functions from Chip's site.

You would paste them into a General Module in your workbook and Excel would
recognise them.

In fact, they would show up in the Function Wizard category "User Defined".

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste Chip's code in there. Save the workbook
and hit ALT + Q to return to your workbook.

Enter the appropriate formula......probably =sumbycolor(range,6)

To get the index number of a cell........

Enter =cellcolorindex(cellref)

Gord

On Wed, 01 Sep 2004 14:00:49 GMT, "George M" <(E-Mail Removed)> wrote:

>Gord
>
>Thanks for the feedback. I am using fill colors - not conditional. I went to
>Chip Pearson's site and studied the series on working with colors. I copied
>his scripts and formula, but get nothing but #name? errors.
>Don't know what is wrong unless I am using the wrong value for Yellow. I am
>trying to search to see if the value is different that what I am using. I am
>using 6 because I did read somewhere that Yellow was 6.
>
>I also tried to use Chip's script to get the color of a cell, but get the
>same error on that.
>
>By the way, I am using Excel 2003, if that makes a difference.
>
>George M
>
>
>
>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>news:(E-Mail Removed)...
>> George
>>
>> If the cells are colored by Conditional Formatting, use that criteria(on)

>to
>> SUM the cells.
>>
>> If not, see Chip Pearson's site for Functions that operate on colored

>cells.
>>
>> Gord Dibben Excel MVP
>>
>> On Wed, 01 Sep 2004 00:02:19 GMT, "George M" <(E-Mail Removed)>

>wrote:
>>
>> >Here is what I am attempting to do:
>> >
>> >If I have a column of numbers (rows 1 through 50)
>> >rows 3,7,12 are colored yellow.
>> >I want to add up the numbers in only columns 3, 7, and 12 (the cells that
>> >are colored yellow)
>> >
>> >Can this be done with a formula?
>> >
>> >Thanks
>> >George M
>> >

>>

>


 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      1st Sep 2004
George,

It's more straightforward to put something in a column that identifies the
cells to be colored, then make cells colored as a function of that data
using either conditional formatting or a macro if you need more than three
colors. Then do your summing based on that column, not the color directly.
For more on this, see www.smokeylake.com/excel. Go to "Excel truths," and
read "Color as data."

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"George M" <(E-Mail Removed)> wrote in message
news:ek8Zc.494814$(E-Mail Removed)...
> Here is what I am attempting to do:
>
> If I have a column of numbers (rows 1 through 50)
> rows 3,7,12 are colored yellow.
> I want to add up the numbers in only columns 3, 7, and 12 (the cells that
> are colored yellow)
>
> Can this be done with a formula?
>
> Thanks
> George M
>
>



 
Reply With Quote
 
George M
Guest
Posts: n/a
 
      1st Sep 2004
Thanks again Gord,

That cleared it up. Works great.
What a great resource Chip's site is!

George M


"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
> George
>
> The #NAME error usually means that Excel does not recognise the Function.
>
> I assume you copied the User Defined Functions from Chip's site.
>
> You would paste them into a General Module in your workbook and Excel

would
> recognise them.
>
> In fact, they would show up in the Function Wizard category "User

Defined".
>
> If not familiar with VBA and macros, see David McRitchie's site for more

on
> "getting started".
>
> http://www.mvps.org/dmcritchie/excel/getstarted.htm
>
> In the meantime..........
>
> To create a General Module, hit ALT + F11 to open the Visual Basic Editor.
>
> Hit CRTL + R to open Project Explorer.
>
> Find your workbook/project and select it.
>
> Right-click and Insert>Module. Paste Chip's code in there. Save the

workbook
> and hit ALT + Q to return to your workbook.
>
> Enter the appropriate formula......probably =sumbycolor(range,6)
>
> To get the index number of a cell........
>
> Enter =cellcolorindex(cellref)
>
> Gord
>
> On Wed, 01 Sep 2004 14:00:49 GMT, "George M" <(E-Mail Removed)>

wrote:
>
> >Gord
> >
> >Thanks for the feedback. I am using fill colors - not conditional. I went

to
> >Chip Pearson's site and studied the series on working with colors. I

copied
> >his scripts and formula, but get nothing but #name? errors.
> >Don't know what is wrong unless I am using the wrong value for Yellow. I

am
> >trying to search to see if the value is different that what I am using. I

am
> >using 6 because I did read somewhere that Yellow was 6.
> >
> >I also tried to use Chip's script to get the color of a cell, but get the
> >same error on that.
> >
> >By the way, I am using Excel 2003, if that makes a difference.
> >
> >George M
> >
> >
> >
> >"Gord Dibben" <gorddibbATshawDOTca> wrote in message
> >news:(E-Mail Removed)...
> >> George
> >>
> >> If the cells are colored by Conditional Formatting, use that

criteria(on)
> >to
> >> SUM the cells.
> >>
> >> If not, see Chip Pearson's site for Functions that operate on colored

> >cells.
> >>
> >> Gord Dibben Excel MVP
> >>
> >> On Wed, 01 Sep 2004 00:02:19 GMT, "George M" <(E-Mail Removed)>

> >wrote:
> >>
> >> >Here is what I am attempting to do:
> >> >
> >> >If I have a column of numbers (rows 1 through 50)
> >> >rows 3,7,12 are colored yellow.
> >> >I want to add up the numbers in only columns 3, 7, and 12 (the cells

that
> >> >are colored yellow)
> >> >
> >> >Can this be done with a formula?
> >> >
> >> >Thanks
> >> >George M
> >> >
> >>

> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorporating Cell color fill in an "if" logical function? =?Utf-8?B?R2VvcmdlX1NreQ==?= Microsoft Excel Worksheet Functions 42 6th May 2010 06:42 PM
How do I change the fill color of a cell using an "IF" function =?Utf-8?B?ZG9uc2NoYXA=?= Microsoft Excel Worksheet Functions 6 9th Mar 2010 03:48 PM
Can I create an "IF" function using cell color as a logical test? JessLynn Microsoft Excel Worksheet Functions 1 25th Jun 2008 08:09 PM
how do i get answer is 1 from CELL("color",sth) function? =?Utf-8?B?VC5UaGluaA==?= Microsoft Excel Misc 1 24th Jun 2005 10:07 AM
How can I make cell A1 a "Y" or "N" depending upon cell A2's font color? Please help. =?Utf-8?B?amRvdmU3OEB5YWhvby5jb20=?= Microsoft Excel Programming 1 16th Oct 2003 08:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:38 PM.