+ Reply to Thread
Results 1 to 5 of 5

IF function with calculations

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    6

    IF function with calculations

    Hey again guys,

    I need to find a way for the IF function to perform some tricky calculations (at least for me). I have three rows. If the value in one row is less than half of the value of the other two rows, then it is true.

    Here is an example:
    row1 row2 row3
    38 53 93

    We see that row1 is less than half of row3 but not of row2.

    But..in this other case:

    row1 row2 row3
    53 21 81

    Row2 is less than half of either of the other two. How would I create a formula to do that, please? Thanks!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: IF function with calculations

    Like this maybe? With your values in A1, A2 and A3

    =IF(OR(AND(A1*2<A2,A1*2<A3),AND(A2*2<A1,A2*2<A3),AND(A3*2<A1,A3*2<A2)),TRUE,FALSE)

  3. #3
    Registered User
    Join Date
    09-14-2010
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: IF function with calculations

    It seems like it works, but would you be able to re-write that using rows C,D,E? I was able to get IF one row is less than the other two rows, but I need to be able to write sort of a permutation. IF row C<D,C<E OR(AND D<C, D<E, OR(AND E<C,E<D. The problem is one row can look like 35 77 100, the next row look like 53 45 10, and the last row look like 80 21 68. I need to be able to find a formula that can flag each of these three situations. I appreciate any and all responses!

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: IF function with calculations

    C, D and E are columns, not rows.

    Replace A1 with C1
    Replace A2 with D1
    Replace A3 with E1

    =IF(OR(AND(C1*2<D1,C1*2<E1),AND(D1*2<C1,D1*2<E1),AND(E1*2<C1,A3*2<D1)),TRUE,FALSE)

    you can copy the formula down and the row references will adjust.

  5. #5
    Registered User
    Join Date
    09-14-2010
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: IF function with calculations

    Oh my goodness thank you!!!

+ 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