+ Reply to Thread
Results 1 to 5 of 5

Nested If Statement Involving Calculations - Having Issues

  1. #1
    Registered User
    Join Date
    04-15-2020
    Location
    NY
    MS-Off Ver
    2016
    Posts
    2

    Nested If Statement Involving Calculations - Having Issues

    Hello Everyone,

    I am new to the community and am reaching out for help with this one! My spreadsheet is testing for the following conditions:

    - If cell A1 is < 30, cell B1 must be within plus or minus 2 of cell A1
    - If cell A1 is between 31 - 100, cell B1 it must be within plus or minus 3 of cell A1
    - If cell A1 is > 100, cell B1 must be within plus or minus 6 of cell A1

    For context, I am doing a series of measurements where the designated measured values are in cell A1 and my measured results are in cell B1. The designated measured values can range from 25 - 120. I am able to have the formula work for range of values 31 - 100 using the following:

    IF(AND(A1>=31,A1<=100),IF(OR(B1<=A1-3,B1>=A1+3),"*Fail","Pass"))

    However, I am having problems when combining all ranges and criteria into a single formula. Any help or suggestions would be very much appreciated!!

    Thank you!

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Nested If Statement Involving Calculations - Having Issues

    would the below work for you?

    =IF(ABS(A1-B1)<=LOOKUP(A1,{25,31,101},{2,3,6}),"Pass","Fail")

    have assumed you only have whole numbers (implied in your post)

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Nested If Statement Involving Calculations - Having Issues

    i think this will do
    =IF(OR(AND(A1<=30,B1>=(A1-2),B1<=(A1+2)),AND(A1>30,A1<=100,B1>=(A1-3),B1<=(A1+3)), AND(A1>100,B1>=(A1-6),B1<=(A1+6)) ),"pass","fail")
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    04-16-2020
    Location
    New York, USA
    MS-Off Ver
    Pro Plus 2013
    Posts
    11

    Re: Nested If Statement Involving Calculations - Having Issues

    Quote Originally Posted by XLent View Post
    =IF(ABS(A1-B1)<=LOOKUP(A1,{25,31,101},{2,3,6}),"Pass","Fail")
    That's slick!
    Last edited by alansidman; 04-19-2020 at 04:10 PM.

  5. #5
    Registered User
    Join Date
    04-15-2020
    Location
    NY
    MS-Off Ver
    2016
    Posts
    2

    Re: Nested If Statement Involving Calculations - Having Issues

    Thank you very much for your suggestions and help, it's working now!

    Thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculations involving text and numbers
    By kierand99 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-17-2018, 04:50 PM
  2. Calculations involving hours and minutes
    By PSAS786 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-15-2015, 02:47 PM
  3. [SOLVED] help with calculations involving minutes
    By mheinmiller in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2014, 10:03 AM
  4. [SOLVED] If nested statement issues
    By winter12 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-12-2013, 10:51 AM
  5. Calculations involving dates...
    By Finalfrontier1976 in forum Excel General
    Replies: 2
    Last Post: 07-13-2011, 07:40 AM
  6. Nested IF statement involving BLANKS
    By Lmsloman in forum Excel General
    Replies: 2
    Last Post: 07-02-2010, 03:29 PM
  7. Calculations Involving Durations in hh:mm, NOT Times
    By h.statsmaster in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-21-2009, 01:43 AM

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