Any syntax to shorten really long IF(formula-test , value-if-true , result of formula) cells?

d0rian

Active Member
Joined
May 30, 2015
Messages
263
I find myself using the following syntax quite a bit, which is resulting in really long text strings that contain a lot of duplicative text...thinking there's got to be a way to shorten them:

Let's say column C has a really-long-formula, but I decide that if the result of the formula is negative, I simply want it to return 0. So what I've been doing for ages is modifying the formula to:
=IF((really-long-formula)<0 , 0 , really-long-formula)

When the formula's REALLY long, it seems really inefficient to make me type out the whole thing twice (and makes troubleshooting a PITA). Is there a better syntax I can use that will only require me to include the really long string once?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,524
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Maybe something like

=MAX(0,really-long-formula)

Hope this helps

M.
 

d0rian

Active Member
Joined
May 30, 2015
Messages
263
Yeah, that would work for this particular example, but I just made it up for ease of understanding; usually that "value-if-true" value is more complicated, sometimes a formula in its own right. I was just hoping there was an Excel formula / syntax I'm unaware of, because usually I find that any time there's a truly duplicative instance, like in my OP, there's a more efficient way to be doing things...
 

d0rian

Active Member
Joined
May 30, 2015
Messages
263
I mean, I could go find an old spreadsheet where I've used this syntax and paste it here, but I'm not looking to solve for just a single permutation of it -- this is a Q I've been meaning to ask for a long time, since it seems to crop up with nearly every excel model I build.
 

bbott

Well-known Member
Joined
Feb 5, 2010
Messages
2,350
It's going to be difficult to improve on something that no one can see. There are a lot of ways around IF statements, but it all depends on what you're trying to accomplish.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,754
Messages
5,638,170
Members
417,011
Latest member
Amaden95

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
Top