

The equal to (=) and not equal to () operators These operators are simple: they tell you whether two values are equal or not equal to each other. Got a different version? No problem, you can still follow the exact same steps.Ĥ: Greater than (>) and less than (=) and less than or equal to () *This tutorial is for Excel 2019/Microsoft 365 (for Windows). Lets take a look at each one of these operators, and then see how you can use them with the IF function. These comparison operators return a TRUE or FALSE value that can be used with logical functions to give you even more options. Statements like greater than, less than or equal to, and not equal to can be very useful when youre analyzing data.

Most of the operators you use in Excel are probably mathematical, like +, -, *, and /.īut theres another set of useful operators: the logical operators. Written by co-founder Kasper Langmann, Microsoft Office Specialist. Output Column: Select the output column by changing number 4, in ws.Cells(x, 4).Equal to, Not equal to, Greater than, Less than (+much more) Test Column: Select the column that captures the cells that are to be tested by changing number 3, in ws.Cells(x, 3). This example assumes that both the output and the associated test cell will be in the same row. Output and Test Rows: Select the output rows and the rows that captures the cells that are to be tested by changing the x values (8 to 14).

Both of these values can be changed to whatever value you desire by directly changing them in the VBA code. If a cell is greater than or equal to a specific value the VBA code will return a value of "No". True and False Results: In this example if a cell is less than a specific value the VBA code will return a value of "Yes". You can also change the name of this object variable, by changing the name 'ws' in the VBA code. Worksheet Selection: Select the worksheet which captures the cells that you want to test if they are less than a specific value and the specific value by changing the Analysis worksheet name in the VBA code. Specific Value: Select the specific value that you want to test other cells against for being less than by changing the value in cell ("C5"). Output Range: Select the output range by changing the cell reference ("D8") in the VBA code.Ĭell to Test: Select the cell that you want to test if it's less than a specific value by changing the cell reference ("C8") in the VBA code.
