Insert value based on color of the cell

A

aberdonian user

Dear Experts,

I wonder if it is possible to insert value from a another cell based on the
color of the cell?

For example in A1:

=IF([Green],B1*30,IF([Yellow],B2*30,0))

Thank you in advance.

Regards,

Jim
 
T

T. Valko

IMHO you should not base calculations on cell formats. The reason is that
changing a cell format does not trigger a calculation so if you change the
cell color your formula *will not* update until some other event triggers a
calculation.

Why are the cells either green or yellow? You can probably build a formula
to do what you want based on the logic of *why* a cell is either green or
yellow.

That being said, look here for the technique:

http://xldynamic.com/source/xld.ColourCounter.html

Make sure you read the section: Constraints!
 
A

aberdonian user

Thanks Biff,

You are right. I made it too complicated. I found another, easy way to do
what I need. Quite happy with that.

Thanks anyway.

Regards,
Jim

T. Valko said:
IMHO you should not base calculations on cell formats. The reason is that
changing a cell format does not trigger a calculation so if you change the
cell color your formula *will not* update until some other event triggers
a calculation.

Why are the cells either green or yellow? You can probably build a formula
to do what you want based on the logic of *why* a cell is either green or
yellow.

That being said, look here for the technique:

http://xldynamic.com/source/xld.ColourCounter.html

Make sure you read the section: Constraints!

--
Biff
Microsoft Excel MVP


aberdonian user said:
Dear Experts,

I wonder if it is possible to insert value from a another cell based on
the color of the cell?

For example in A1:

=IF([Green],B1*30,IF([Yellow],B2*30,0))

Thank you in advance.

Regards,

Jim
 
T

T. Valko

Good deal. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


aberdonian user said:
Thanks Biff,

You are right. I made it too complicated. I found another, easy way to do
what I need. Quite happy with that.

Thanks anyway.

Regards,
Jim

T. Valko said:
IMHO you should not base calculations on cell formats. The reason is that
changing a cell format does not trigger a calculation so if you change
the cell color your formula *will not* update until some other event
triggers a calculation.

Why are the cells either green or yellow? You can probably build a
formula to do what you want based on the logic of *why* a cell is either
green or yellow.

That being said, look here for the technique:

http://xldynamic.com/source/xld.ColourCounter.html

Make sure you read the section: Constraints!

--
Biff
Microsoft Excel MVP


aberdonian user said:
Dear Experts,

I wonder if it is possible to insert value from a another cell based on
the color of the cell?

For example in A1:

=IF([Green],B1*30,IF([Yellow],B2*30,0))

Thank you in advance.

Regards,

Jim
 

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