Forum Discussion

ChristianMaurer's avatar
ChristianMaurer
Copper Contributor
Aug 05, 2022
Solved

IF formula not correctly displaying

I am currently attempting to troubleshoot an IF formula statement. I am trying to filter out different numbers from 2 separate columns. I would like to keep all values between 1000 and 10000, with a special property given to numbers in cell P that are higher than the value in cell O while still under the range of >10000. My current If statement is: =IF(AND(P2>1000,P2>O2,P2<10000),P2,O2). I have tested this on an older version of Excel for Mac, and on Google Sheets and both work properly. Only when I am on Excel for windows does it not work (Version 2206. I have gone through each of the logicals separately and have concluded that O2<10000 is the only one that displays incorrectly.

O2: 4000    P2: 4500 (Needs to display column P) [Displays O2]

O2: 4000    P2: 0        (Needs to display O) [Displays O2]

O2: 4000    P2: 20000 (Needs to display O) [Displays O2]

O2: 4000    P2: 400 (Needs to display O) [Displays O2]

EDIT: Formula has been corrected. Still wrong, but more akin to my actual setup

 

  • My first thought was to check that the 4500 in B2:4500 is entered as a number and not text. This happens to me sometimes when I copy numbers from another source. Should be no leading apostrophe ('), no spaces, etc. Also, highlight all the cells and explicitly define them as a number.

  • ScottLamond's avatar
    ScottLamond
    Brass Contributor

    My first thought was to check that the 4500 in B2:4500 is entered as a number and not text. This happens to me sometimes when I copy numbers from another source. Should be no leading apostrophe ('), no spaces, etc. Also, highlight all the cells and explicitly define them as a number.

    • ChristianMaurer's avatar
      ChristianMaurer
      Copper Contributor
      I was able to reconfigure the formula in a new sheet. It must have something to do with the values not being displayed correctly. I should be able to figure it out given some time. Just need to display the formula values as normal values. Thank you.
    • ChristianMaurer's avatar
      ChristianMaurer
      Copper Contributor
      I thought it was that at first because of the way I was pulling the information, but I tested it separately.
      • ScottLamond's avatar
        ScottLamond
        Brass Contributor
        The issue I sometimes experience is if I enter data into a cell that was not in the original range selection. I'm now in the habit of making sure I insert a row between the top and bottom cells, since the software is designed to assume that I want it in the total.

Resources