I'm trying to achieve something like:
=IF( N2="string1", "high", IF( N2="string2" or N2="string3","middle","low") )
Or, in psuedo code:
String input = <some value>
if( input.equals("string1") ) {
return "high"
} else if ( input.equals("string2) || input.equals("string3") ) {
return "middle"
}
return "low"
Any idea how I can do that using a spreadsheet (Libre Office Calc ideally) formula rather than code? Where the input variable would obviously be a cell reference.
LibreOffice has 1440 reviews and a rating of 4.32 / 5 stars vs Microsoft Excel which has 17280 reviews and a rating of 4.77 / 5 stars. Compare the similarities and differences between software options with real user reviews focused on features, ease of use, customer service, and value for money.
Syntax. Use the IF function, one of the logical functions, to return one value if a condition is true and another value if it's false. For example: =IF(A2>B2,"Over Budget","OK")
Using your example of "N2" as the cell reference, the formula would be the following:
=IF( N2="string1", "high", IF( OR(N2="string2",N2="string3"),"middle","low") )
If you would like to read up on the "OR" Function in Libre Office, you can click here.
Please let me know if that doesn't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With