If function - Shortcut?

  • Ozgrid,


    My "If" formula if VERY long and I am having to essentially include it twice to make my formula work. Am I missing a simple way to cut it in half or use the "If" function more effeciently? My formula goes: If("very very long formula" is true then, "insert very very long formula all over again here", otherwise false). Other than some VBA - is there a formula like: If("very very long formula" is true then, print the answer, otherwise false).


    Thanks for listening,
    David

  • Re: If function - Shortcut?


    Hi David,


    You name the "Very Very Long formula" and use that name in the formula.


    For naming your formula: Insert - Name -Define - Refers to:


    Type your formula in Refers to: box and give a name to it in the Names in Workbook box(make sure to give a very very small name :wink: ).


    HTH.

  • Re: If function - Shortcut?


    Roy,


    That's a pretty simple alternative. It would sure make it a lot simpler to look at and decipher. And I guess that means "No" as far as an easier way to use the "If" statement. No doubt there's a reason behind it's logic setup - I hope.


    Thank You,
    David

  • Re: If function - Shortcut?


    Pradeep,


    Thanks for the naming suggestion! I've put off learning how to use the naming functions for too long. So I've spent the last few days learning the ins and outs of naming and labels. Thanks for pushing me to "dive in". It's looks like the route to take for my "problem".


    Regards,
    David

  • Re: If function - Shortcut?


    Hello Norie,


    I've posted my long formula below like you suggested. It's about 5 lines long on my screen and it sure is a nuisance when it is "open". One reason it is long is so I will have a clue if I have to mod it several months from now (is why some numbers aren't already added or divided in advance). Some of the constants will get changed to variables (cell references) later as well. But if anyone see a better way to do it, or a better function to use - I am so for it!!


    The formula figures the fuel to add to one side so that the other side is not too heavy. It will fill one tank up to 1554 lbs and then put the rest in the other tank up to 2680 lbs. The fuel tanks are located at different "arm" positions. If it takes more than 4234 lbs total to bring it within balance then it outputs ">4234", If the answer is negative that is ok.


    Code
    =IF(((I14*S14/2+116.5-263.1)*N14 + (I16*S16/2+I14*S14+116.5-263.1)*N16 + (I18*S18/2+I16*S16+I14*S14+116.5-263.1)*N18 + 417*10000-263.1*W27)/(263.1-163)<=1554, ROUNDUP(((I14*S14/2+116.5-263.1)*N14 + (I16*S16/2+I14*S14+116.5-263.1)*N16 + (I18*S18/2+I16*S16+I14*S14+116.5-263.1)*N18 + 417*10000-263.1*W27)/(263.1-163),0),IF(((I14*S14/2+116.5-263.1)*N14 + (I16*S16/2+I14*S14+116.5-263.1)*N16 + (I18*S18/2+I16*S16+I14*S14+116.5-263.1)*N18 + (417*10000-1554*(263.1-163)) - (263.1*W27))/(263.1-240) + 1554<=4234, ROUNDUP(((I14*S14/2+116.5-263.1)*N14 + (I16*S16/2+I14*S14+116.5-263.1)*N16 + (I18*S18/2+I16*S16+I14*S14+116.5-263.1)*N18 + (417*10000-1554*(263.1-163)) - (263.1*W27))/(263.1-240) + 1554,0),"> 4234"))


    Thanks again Norie and whomever might take the time to read this,
    Cheers,
    David

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!