+ Reply to Thread
Results 1 to 4 of 4

Plug Variables into Formula

  1. #1
    Registered User
    Join Date
    12-11-2012
    Location
    New York City
    MS-Off Ver
    Excel 2010
    Posts
    2

    Plug Variables into Formula

    Formula:
    =IF((ISNUMBER(SEARCH("H",F8))),(IF((K8=0),0,IF((K8<505),75,IF((K8<2000),(K8*0.15),IF((K8=2000),(K8*0.2),IF((K8>2000),(K8*0.2))))))),IF((K8=0),0,IF((K8<505),100,IF((K8<2000),(K8*0.15),IF((K8=2000),(K8*0.2),IF((K8>2000),(K8*0.2)))))))


    Argument:

    (ISNUMBER(SEARCH("H",F8)))

    TRUE Then,

    (IF((K8=0),0,IF((K8<505),75,IF((K8<2000),(K8*0.15),IF((K8=2000),(K8*0.2),IF((K8>2000),(K8*0.2)))))))

    FALSE Then,

    (IF((K8=0),0,IF((K8<505),100,IF((K8<2000),(K8*0.15),IF((K8=2000),(K8*0.2),IF((K8>2000),(K8*0.2)))))))


    The formula above works but I need to plug in two more variables that are giving me conflicts.
    If K8<505 and U8>100 are true Then K8*0.15 must occur and the above argument is bypassed. How can I plug these variables in the same cell.

  2. #2
    Registered User
    Join Date
    01-16-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Plug Variables into Formula

    I'm sorry if I am misunderstanding your request, but if you want K8<505 and U8>100 are true Then K8*0.15 to happen before the rest of your formula, could you write it like this:

    =IF(AND(K8<505,U8>100),K8*.15,IF((ISNUMBER(SEARCH("H",F8))),(IF((K8=0),0,IF((K8<505),75,IF((K8<2000),(K8*0.15),IF((K8=2000),(K8*0.2),IF((K8>2000),(K8*0.2))))))),IF((K8=0),0,IF((K8<505),100,IF((K8<2000),(K8*0.15),IF((K8=2000),(K8*0.2),IF((K8>2000),(K8*0.2))))))))

    If you are running into a problem with too many nested functions I think you could work from high to low, [IF((K8>2000),(K8*0.2)] first, and not include the [IF((K8=0),0)] ending your formula with just "0" so that if no other criteria are true zero is returned. Unless you have negative numbers in your data, then there is a bit a of a problem.

  3. #3
    Registered User
    Join Date
    12-11-2012
    Location
    New York City
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Plug Variables into Formula

    Thank you matt I will plug this in and see what results i get.

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Plug Variables into Formula

    Can you also try this one.



    edit :bug with this one.
    =IF(K8=0,0,IF(ISNUMBER(SEARCH("H",F8)),IF(K8<505,75),100)+IF(K8>504,LOOKUP(K8,{505,2000},{0.15,0.2})*K8))


    from my original (working)
    =IF(K8=0,0,IF(ISNUMBER(SEARCH("H",F8)),IF(K8<505,75,LOOKUP(K8,{505,2000},{0.15,0.2})*K8), IF(K8<505,100,LOOKUP(K8,{505,2000},{0.15,0.2})*K8)))



    found it:

    =IF(K8=0,0,IF(ISNUMBER(SEARCH("H",F8)),IF(K8<505,75),IF(K8<505,100))+IF(K8>504,LOOKUP(K8,{505,2000},{0.15,0.2})*K8))
    Last edited by vlady; 12-11-2012 at 09:47 PM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ 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