Multiple if conditions or validation

ssbhatban

Board Regular
Joined
Oct 20, 2015
Messages
81
Office Version
  1. 2010
Platform
  1. Windows
Dear friends
I am evaluating the dimensions achieved in a metal Shaft & entering it in excel sheet. Points out of 10 are to be alloted depending upon the dimension achieved
I am entering the dimension achieved in D5 & points should come in E5 depending on the dimension entered. I have three conditions. For example
If the value is between 69.95 and 70.05 then return value is 10
Value between 69.94 & 69.00 & value between 70. 06 & 70 10 return value is 9
Value between 68.99 & 68.95 & value between 70.11 & 70.15 return value is 7

Kindly help me with the syntex. Thanks in advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Just Google or search the forum for nested IF statements.

VBA Code:
IF(condition1, result1, IF(condition2, result2, IF(condition3, result3, result4)))
 
Upvote 0
D
Just Google or search the forum for nested IF statements.

VBA Code:
IF(condition1, result1, IF(condition2, result2, IF(condition3, result3, result4)))
Dear friend
I am beginner in excel & googled. I got some syntax for nested multiple if, I have got it right for two numbers, but I have 4 nos for each Criteria. I am not able to solve it
 
Upvote 0
If the value is between 69.95 and 70.05 then return value is 10
Value between 69.94 & 69.00 & value between 70. 06 & 70 10 return value is 9
Value between 68.99 & 68.95 & value between 70.11 & 70.15 return value is 7
Are you sure those values are correct. It sounds like you are awarding high points for getting close to 70? However, the values on either side of 70 are not evenly matched as shown below.
Green ones match each side but amber ones do not.

Book1
HIJKLMNOPQR
1168.9568.996969.9469.957070.0570.0670.170.1170.15
121.051.0110.060.050.050.060.10.110.15
Points


.. or have I missed the point?
 
Upvote 0
Or you can use the following formula:

=IFS(AND(D5>=69.95,D5<=70.05),10,AND(D5>=69.94,D5<=69),9,AND(D5>=70.06,D5<=70.1),9,AND(D5>=68.99,D5<=68.95),7,AND(D5>=70.11,D5<=70.15),7)

Please note IFS formula is available from 2016 Excel.

Kind regards

Saba
 
Upvote 0
Or you can use the following formula:

=IFS(AND(D5>=69.95,D5<=70.05),10,AND(D5>=69.94,D5<=69),9,AND(D5>=70.06,D5<=70.1),9,AND(D5>=68.99,D5<=68.95),7,AND(D5>=70.11,D5<=70.15),7)

Please note IFS formula is available from 2016 Excel.

Kind regards

Saba
Thanks guys, got it, working fine. Thanks for all of your help
 
Upvote 0
yes you are right, the values had little problem, thanks for bringing it to notice

i used this

=IF(AND(D5>=69.95,D5<=70.05),"10",IF(AND(D5>=69.9,D5<=70.1),"9",IF(AND(D5>=69.85,D5<=70.15),"7",IF(AND(D5>=69.8,D5<=70.2),"5",IF(AND(D5>=0,D5<=100),"2",)))))
 
Upvote 0
i used this

=IF(AND(D5>=69.95,D5<=70.05),"10",IF(AND(D5>=69.9,D5<=70.1),"9",IF(AND(D5>=69.85,D5<=70.15),"7",IF(AND(D5>=69.8,D5<=70.2),"5",IF(AND(D5>=0,D5<=100),"2",)))))
Unless you are specifically trying to return text values, you would be best to remove the quotes from around all the numerical values to return (I've highlighted just a few)

From what I can tell, you could also use this much shorter formula with no IFs at all.

=LOOKUP(ABS(70-D5),{0,0.0501,0.101,0.1501,0.201},{10,9,7,5,2})
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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