If function, create a certain value within a number range.

Roggan81

New Member
Joined
Jan 23, 2011
Messages
4
Hi!

I need some help creating a formula to help making my scheduling more automatic. This is the problem I need help with:

I need a formula to create a value for me if a number in a specific cell is within a certain number range.

exemple:
If A1 is between 0 and 39, if true 0, if false 0.
If A1 is between 39 and 78, if true 30, if false 0.
If A1 is between 78 and 117, if true 60, if false 0.
If A1 is between 117 and 400, if true 90, if false 0.

I tried this, but it doesn´t work:
These formulas are written in B1 to E1

=if(39>A1>0; 0; 0)<A1<39; p ;0)< 0>
=if(78>A1>38; 30; 0)<A1<39; p ;0)< 0><A1<78; p ;0)< 30>
=if(117><A1<117; p ;0)< 60>A1>78; 60; 0)<A1<39; p ;0)< 0>
=if(400><A1<400; p ;0)< 90>A1>117; 90; 0)<A1<39; p ;0)< 0>

Maybe one of you smart guys/girls can help me on this one or suggest a better suitable funtion for me? :)
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi and welcome to the Board
Try
Code:
=IF(A1<39,0,IF(A1<78,30,IF(A1<117,60,IF(A1<400,90,0))))
 
Upvote 0
It seems you are using european format style of excel, just simply replace "," with ";" in formulas

=IF(A1<39;0;IF(A1<78;30;IF(A1<117;60;IF(A1<400;90;0))))</pre>
 
Upvote 0

Forum statistics

Threads
1,215,530
Messages
6,125,353
Members
449,220
Latest member
Edwin_SVRZ

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