+ Reply to Thread
Results 1 to 4 of 4

What is the purpose of IF

  1. #1
    Registered User
    Join Date
    09-15-2006
    Posts
    8

    What is the purpose of IF

    Hi,

    What is the purpose of IF for this formula
    =IF(ABS((AL$5-$Q7)*$AG7)>ABS(AJ7),0,(AJ7-((AL$5-$Q7)*$AG7)))

    What is the formula doing?

    Thanks.

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    The basics of the IF formula are

    IF A THEN B ELSE C
    In excel it looks like =IF(A,B,C)
    In the case of your formula the A is
    ABS((AL$5-$Q7)*$AG7)>ABS(AJ7)

    Which is comparing the absolute value (ABS) of result the number in cell AL5 minus the number in cell Q7 that result multiplied by the number in cell AG7 and the number in AJ7. IF the value of the first portion [ABS((AL$5-$Q7)*AG7)] is Greater Than (>) the value of the second portion [ABS(AJ)] then it will return TRUE for A and move to B, if it is not Greater than, then it Returns FALSE and return to C.

    The B in this formula is a static 0

    The C in this formula is (AJ7-((AL$5-$Q7)*$AG7))

  3. #3
    Registered User
    Join Date
    09-15-2006
    Posts
    8
    Hi

    How about this one
    =IF(OR(W41="ABS",W41="MBS",W41="CMO",X41="Lotteries"), 1,0)

    Thanks

  4. #4
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    The OR function adds a slightly new dimension into it

    Rather than IF A THEN B ELSE C

    It becomes IF A OR D THEN B ELSE C

    The OR function can hold mulitple conditions that it could be, in your case it seems that if the value in cell W41 is "ABS", "MBS", or "CMO" or if Cell X41 = "Lotteries" then it will pass the TRUE statement and return B (1), and if none of the statments are correct than it will return C (0).

    Hope this is helping.
    John

+ 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