Adding text to an IF statement effeciently

B

Bishop

I have the following code in a cell on Sheet A:

=IF(E41>H41,"Rock on, Man! You are EXCEEDING your Stretch goal for the
month!",IF(E41>=H41,"Nice work! You are meeting your stretch goal for the
month!",IF(E41>=G41,"Great work. You are meeting your Target
goal.",IF(E41>=F41,"You are meeting Threshold. Which is the bare
minimum.",IF(E41<F41,"Um... so yeah... you might want to do some work,
Dude.")))))

What I would like to do is assign each quote to a variable on Sheet B like
such:

exceed = "Rock on, Man! You are EXCEEDING your Stretch goal for the month!"
stretch = "Nice work! You are meeting your stretch goal for the month!"
target = "Great work. You are meeting your Target goal."
threshold = "You are meeting Threshold. Which is the bare minimum."
slack = "Um... so yeah... you might want to do some work, Dude."

And I would like to replace the code above with something like this:

=IF(E41>H41,exceed,IF(E41>=H41,stretch,IF(E41>=G41,target,IF(E41>=F41,threshold,IF(E41<F41,slack)))))

What is the correct syntax to make this work?
 
J

Jim Thomlinson

You can do that with Named Ranges. Named ranges return cell references
typically but there is no reason why it can not return a text string. Try
this...
Insert | Name | Define
Under names in this workbook: Add
Exceed
Under Refers to: add
= "Rock on, Man! You are EXCEEDING your Stretch goal for the month!"

Now in a cell type the formula
=Exceed

You can also use Exceed in your formulas just as you posted...
 
B

Bishop

Exactly what I was looking for. Thank you!

Jim Thomlinson said:
You can do that with Named Ranges. Named ranges return cell references
typically but there is no reason why it can not return a text string. Try
this...
Insert | Name | Define
Under names in this workbook: Add
Exceed
Under Refers to: add
= "Rock on, Man! You are EXCEEDING your Stretch goal for the month!"

Now in a cell type the formula
=Exceed

You can also use Exceed in your formulas just as you posted...
 

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