Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel integer to boolean condition

Creating a spreadsheet that has a bunch of test cases and at the end says pass or fail.

all values right now are either "Pass" or "fail". I need to be able to have a conditional where I can type in like a number. if it is above 5 i need it to return a pass. if it is below 5 i need it to return a false. any solutions guys?

like image 449
user2569803 Avatar asked Nov 19 '25 18:11

user2569803


1 Answers

The following might be the way to go:

enter image description here

where you enter a value in B1, which is then used to condition on. It's usually easier and more transparent to have a column that contains the conditioned value that is separate from the original data.

Another option might be conditional formatting. In this case, you condition on the value in a cell. Here I've formatted the cells to display a green/yellow/red dot (traffic sign) depending on the value in the cell.:

enter image description here

with the output resembling

enter image description here

Another option is to change the formatting of the cell to a specific "Custom" formatting:

enter image description here

Read more about how to Create a custom number format on Microsoft's help page.

A final option (that is a bit more intricate) requires you to set multiple, mutually exclusive, conditional formatting of the cells as well as separate "Custom" cell formatting:

enter image description here

Note that the cell entry A4 has a value of 16, while the display is actually "Pass" (since it's greater than 8 (cell B1). The steps for obtaining this include:

  1. Create a conditional formatting using the "Use a formula to determine which cells to format" option.

  2. Specify the "Format values where this formula is true" as depicted above (removing the dollar signs inserted around A4 by default), while setting the format using "Custom":

    enter image description here

  3. Do the same for the other (mutually exclusive) condition by creating a new rule for the same cell ("Format values where this formula is true:" =A4<=$B$1 and setting the "Custom" format to "Fail").

  4. Once both conditional formatting rules are set, change the "Applied to" field to fit your range:

    enter image description here

like image 69
Werner Avatar answered Nov 24 '25 09:11

Werner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!