Forum Discussion

Chris Fernandez's avatar
Chris Fernandez
Copper Contributor
Jun 13, 2017

Formula Help Please

I have an average number in one cell and if it falls in between 2 numbers located in 2 seperate cells i want it to read "Pass" or "Fail" if it's outside the parameters in a seperate cell.

  • No need to over complicate things, you can use the following simple formula:

    =IF(AND(G4>H4,G4<I4),"Pass","Fail")

    • SergeiBaklan's avatar
      SergeiBaklan
      MVP

      Hi Zachary,

       

      1) It's misprint in your formula, correct syntax as in Vladislavs' post

      2) I really don't understand why Detlefs' variant is complex and/or less preferable...

      • Zachary Grotovsky's avatar
        Zachary Grotovsky
        Brass Contributor
        Thanks for pointing out the forgotten peren. To me cell references use less features than named ranges, which makes it easier and less complicated. The functionality will be the same, but referencing cells instead of named ranges seems easier to me.
  • I think this is better:

     

    =IF(AND(AverageNumber>=Lower;AveregeNumber<=Upper),"Pass","Fail")

     

  • Detlef_Lewin's avatar
    Detlef_Lewin
    Silver Contributor

    Hello Chris

     

    =IF(MEDIAN(AverageNumber,Lower,Upper)=AverageNumber,"Pass","Fail")

     

    • Chris Fernandez's avatar
      Chris Fernandez
      Copper Contributor

      What can i add to this formula to hide the error message when cell refernces aren't in the cell? I tried adding if(c4=0,"", then your formula), but it messes thing up. Thanks again in advance.

    • Chris Fernandez's avatar
      Chris Fernandez
      Copper Contributor

      Thanks for the assist guys, but neither worked for my particular application. Here is a visual of what i'm trying to accomplish. If F4 is <H8 or >I4 it should read Q4. If it falls betrween the 2 parameters it should read Q5. Thaks again in advance. 

      • Detlef_Lewin's avatar
        Detlef_Lewin
        Silver Contributor

        Both formulas work fine.

        I can't see your formula in the screenshot.

         

Resources