+ Reply to Thread
Results 1 to 3 of 3

Consolidating If statement with repeating functions

  1. #1
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Consolidating If statement with repeating functions

    This works fine for me, but curios if there is any way to consolidate this If statement based on the fact there are repeating functions.

    H2 >> Old Value
    D2 >> New Value
    J2 >> 25%

    Checks New Value to see if it is either 25% above or below the Old Value

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 01-21-2012 at 05:27 PM.
    HTH
    Regards, Jeff

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Consolidating If statement with repeating functions

    This effectively does the same thing, not sure if it's better.

    =TEXT(D2/H2-1,"0.0% ") & LOOKUP(D2/H2-1,{-1,-0.2499,0.25},{"▼","◊","▲"})
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Consolidating If statement with repeating functions

    Thank you Jerry this is great. I wasn't neccesarily looking for anything better, but just wanted to see how it could be written smarter or more compact.

    In the end I have gone with...

    =IF(D2=H2,"Match",TEXT(ABS(D2/H2-1),"0.0% ")&LOOKUP(SIGN(D2/H2-1),{-1,1},{"▼","▲"}))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1