Nested IF statement

CJJC

New Member
Joined
Dec 6, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to return a value based on a range. If the value in D17 is >=50%, then return 3, if 20-49% then return 2, if 0-19% return 1, if -1 to -20%, return 0.3, if -20 - -49% return 0.2 and if <=-50% return 0.1

I've tried the following IFS statement =IFS(D17>=50,"3",20,"2",0,"1",-1,"0.3",-20,"0.2",-50,"0.1"), but it seems to be hung up on the range of 0-19 the return is 2 for all the values.

Where have I gone wrong?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi & welcome to MrExcel.
You need to specify the D17>= for each check, not just the 1st one.
 
Upvote 0
D17 = 33%

When I try =IF(D17>=50,"3",IF(D17>=20,"2",IF(D17>=0,"1",IF(D17>=-1,"0.3",IF(D17>-20,"0.2",IF(D17>=-50,"0.1")))))) the return is 1 instead of 2

??????
 
Upvote 0
try
Excel Formula:
=LOOKUP(D17,{-9E+99,-0.2,0,0.2,0.5},{0.2,0.3,1,2,3})
 
Upvote 0
If D17 is a real percentage then you need to use
Excel Formula:
=IF(D17>=50%,"3",IF(D17>=20%,"2",IF(D17>=0%,"1",IF(D17>=-1%,"0.3",IF(D17>-20%,"0.2",IF(D17>=-50%,"0.1"))))))
 
Upvote 0
If D17 is a real percentage then you need to use
Excel Formula:
=IF(D17>=50%,"3",IF(D17>=20%,"2",IF(D17>=0%,"1",IF(D17>=-1%,"0.3",IF(D17>-20%,"0.2",IF(D17>=-50%,"0.1"))))))
That worked!!! Thank you so very much
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,766
Messages
6,126,761
Members
449,336
Latest member
p17tootie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top