×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Calculation Field Help Needed

Calculation Field Help Needed

Calculation Field Help Needed

(OP)
I have a Calculation field "A" which is already a SUM of several number fields. I would like to compare the field "A" with another field "B".   And if field "A" is smaller then field "B", I would like to have the number in field "A" display in RED. If "A" is larger than "B" then it needs to be in GREEN color.
How would you write such a calculation, please ?  And how to add it to the existing SUM calculation ?
Thank you in advance from a "newbie" !

RE: Calculation Field Help Needed

Try this:

Case (

field_a ? field_b; field_a;
field_a < field_b; TextColor ( field_a; RGB ( 255; 0; 0 ) )

 )


RE: Calculation Field Help Needed

Sorry, didn't read your post completely.  Try this instead ...

Call this calculation field "c_field_a" and

Case (

Sum ( numb_field1;numb_field2;numb_field3 ) ? field_b; TextColor ( Sum ( numb_field1;numb_field2;numb_field3 ); RGB ( 0; 255; 0) );
Sum ( numb_field1;numb_field2;numb_field3 ) < field_b; TextColor ( Sum ( numb_field1;numb_field2;numb_field3 ); RGB ( 255; 0; 0) )

 )


RE: Calculation Field Help Needed

Apparently I can't get out of my own way tonight ... one more time from the top ...

Case (

Sum ( numb_field1;numb_field2;numb_field3 ) = field_b; Sum ( numb_field1;numb_field2;numb_field3 );

Sum ( numb_field1;numb_field2;numb_field3 ) > field_b; TextColor ( Sum ( numb_field1;numb_field2;numb_field3 ); RGB ( 0; 255; 0) );

Sum ( numb_field1;numb_field2;numb_field3 ) < field_b; TextColor ( Sum ( numb_field1;numb_field2;numb_field3 ); RGB ( 255; 0; 0) )

 )

This assumes that you want the color to be the default black if the values in field a and field b are the same.

You could also avoid typing those annoying sum fields over and over again by using the Let function.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close