Need formula - fast!

AlpineResident

New Member
Joined
May 9, 2012
Messages
2
I have been unable to construct a single IF statement to handle these conditions:

IF B3 value >6 return 100%
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
IF B3 Value >6 but < 12 return .66
<o:p> </o:p>
IF b3 value >12 but < 24 return .33
<o:p> </o:p>
IF B3 value >24 return 0

Please assist. Thanks for your help!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I have been unable to construct a single IF statement to handle these conditions:

IF B3 value <=6 return 100%
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
IF B3 Value >6 but <= 12 return .66
<o:p></o:p>
IF b3 value >12 but <= 24 return .33
<o:p></o:p>
IF B3 value >24 return 0

Please assist. Thanks for your help!

I am assuming you meant the prevoius instead of >6 which would give formula
=IF(B3>24,0,IF(B3>12,0.33,IF(B3>6,0.66,1)))
 
Upvote 0
I think your first condition should be

IF B3 <6 return 100%

This will do it, but there are surely better ways of doing it.

=IF(B3>24,0,IF(B3>12,0.33,IF(B3>6,0.66,1)))

For the case where B3=6, B3=12, B3=24, it returns values of 100%, 66%, 33% respectively.

You may have to use >=, or <= conditions to fine tune those situations.
 
Upvote 0
Yes, this is a better way of doing it. Make sure you type the formula in the cell, and NOT HIT ENTER - but -- HIT CTRL-SHIFT-ENTER
 
Upvote 0
Assuming you meant B1<6 is 100%

Excel Workbook
BCD
13100%IF B3 value >6 return 100%
2
370.66IF B3 Value >6 but
4
5150.33IF b3 value >12 but
6
7300IF B3 value >24 return 0
Sheet4
 
Upvote 0
Welcome to the board..

Try

=LOOKUP(B3,{0,6,12,24},{1,0.66,0.33,0})

This is likely the best solution so long as you will never have negative values. That is really the only draw-back in my mind to using Lookups is you have to make sure you supply a first value that is below any possible value in the lookup cell (B3)

I suppose to that end, if you expect you will ever have negative values you could always use this...
=LOOKUP(B3,{-1E+99,6,12,24},{1,0.66,0.33,0})

-1E99 is -100000000.... (99 0's after the one) so basically a ridiculously negative value.
 
Upvote 0
Thanks, all!

I'll try the various combinations you suggested. My workaround until I heard from you experts was to use a vlookup table.

I appreciate the quick responses - very impressive!
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

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