IF Statement: Easy way to "reuse" the Test Condition?

rbm

New Member
Joined
May 24, 2011
Messages
2
Either I am blind and can not find my answer, or my want is unobtainable...

Excel 2003, IF statement formula.

I desire an easier way to code:
IF(testcondition<>some value, testcondition, something else)

where testcondition may be a very long statement that I do not wish to repeat within the IF statement twice.

Here is a smaller example:
If(Vlookup(bonus,bigarray,1)>1000,Vlookup(bonus,bigarray,1),"little")

Of course, I can throw the testcondition into a different cell range, and the above would become:
If(testcell>1000,testcell,"little")
but I am trying not to go that route.


Any words of wisdom out there?
Many Thanks,
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Set your test condition as a name.

Get your test condition and set it up as a stand alone formula. Copy the formula from the formula bar. Press CTRL-F3 to open the name manager. Make a new name and name it what you want, like TC or whatever and paste the formula you copied before in "Refers to" section.

Now if you take any cell and type =TestCondition you'll get the result and you can use it in the formula.
 
Upvote 0
WOW! Absolutely fantastic and works perfectly. I use names all the time for other reasons, but never played with sticking a formula into the "refers to".

Many, many thanks. Lots of IF statements are going to become much more readable.

RBM
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,259
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top