+ Reply to Thread
Results 1 to 3 of 3

How to calculate IF, NOT, THEN, OR

  1. #1
    Registered User
    Join Date
    02-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to calculate IF, NOT, THEN, OR

    Dear All,
    I hope someone can help me with a spreadsheet query. I need to write formula which tells me this:

    IF the value in A1 is greater than 27 or less than 32, THEN cell B1 equals zero. BUT if A1 is less than 27, B2 = the absolute value of A1 minus 27, OR IF A1 is greater than 32, B2= the value of A1 minus 32.

    I hope this makes sense to someone, please let me know if I can clarify anything. Excel and I are not entirely sophisticated companions

    Thankyou Kindly,
    Ophidio
    Last edited by Ophidiophobe; 02-26-2010 at 02:26 AM. Reason: Prefix

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: How to calculate IF, NOT, THEN, OR

    Hi Ophidiophobe, and welcome to the forum.

    This may work for you:

    =IF(A1<27,ABS(A1-27),IF(A1<=32,0,A1-32))

    And I think instead of "IF the value in A1 is greater than 27 or less than 32" I think you mean (IF the value in A1 is greater than 27 and less than 32" (aka "between 27 and 32, inclusive").

  3. #3
    Registered User
    Join Date
    02-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How to calculate IF, NOT, THEN, OR

    Thanks so very much Paul. My PhD thesis thanks you as well! The formula you posted allows me to run bootstrapping analysis which re-computes a data set dependent on a new set of random numbers each time using your formula (1000 iterations).

    THANKS AGAIN MATE, YOU ARE WORTH A MILLION

+ 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