Aug 18 2023 12:08 PM
I am trying to get a cell in a spreadsheet to evalute a formula that is coming up with a percentage and then based on ranges populate the cell with a text value this is what I have so far but I am missing something as it isnt recognizing it as a valid formula.
=SWITCH(Status,AND((Q4/B4*100)>=MIN(96), (Q4/B4*100)=<MAX(100)),"Undamged",AND((Q4/B4*100)>=MIN(75), (Q4/B4*100)<=MAX(95.99)),"Light Damage", AND((Q4/B4*100)>=MIN(50), (Q4/B4*100)=<MAX(74.99)),"Medium Damage", AND((Q4/B4*100)>=MIN(25), (Q4/B4*100)=<MAX(49.99)),"Heavy Damage",AND((Q4/B4*100)>=MIN(.01), (Q4/B4*100)=<MAX(24.99)),"Crippled","?")
Im sure its something simple any suggestions or heck if there is a better way to do this I am all ears. Still pretty new with excel and doing things like this. Thanks for any help.
Aug 18 2023 12:17 PM
Aug 18 2023 12:36 PM
SolutionPerhaps
=IFNA(
LOOKUP(
Q4 / B4 * 100,
{0.01, 25, 50, 75, 96},
{
"Crippled",
"Heavy Damage",
"Medium Damage",
"Light Damage",
"Unmanaged"
}
),
"?"
)
Aug 18 2023 12:48 PM
Aug 18 2023 01:14 PM
To make it more reliable from maintainability point of view you may put numbers and texts into some helper table within workbook and use any lookup function to get data from it.
Aug 18 2023 12:36 PM
SolutionPerhaps
=IFNA(
LOOKUP(
Q4 / B4 * 100,
{0.01, 25, 50, 75, 96},
{
"Crippled",
"Heavy Damage",
"Medium Damage",
"Light Damage",
"Unmanaged"
}
),
"?"
)