Floor Function Not Working

VinceF

Board Regular
Joined
Sep 22, 2007
Messages
199
Office Version
  1. 2016
Platform
  1. Windows
Greetings,

This should be an easy one for the experts.

In cell G12 the result of the formula is 54, I tried every conceivable way that I can think of to configure the formula so that the Floor function rounds the 54 to 50

Appreciate you for your assistance.

VinceF
Excel 2016

=IF(K12=1,PAY!$C$27,IF(K12=2,PAY!$D$27,IF(K12=3,PAY!$E$27,FLOOR(G12,5))))
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
That should work. What value are you getting?
 
Upvote 0
i'm assuming K12 does not = 1,2 or 3
seems to work on its own, nearest 5
 
Upvote 0
""i'm assuming K12 does not = 1,2 or 3""
Incorrect....K12=2 in the formula which is 54

""seems to work on its own, nearest 5""
Correct, if it stands alone it works just fine, however it is not working in the formula as written. I tried several different configurations and at this point I'm not able to get it working.

=IF(K12=1,PAY!$C$27,IF(K12=2,PAY!$D$27,IF(K12=3,PAY!$E$27,FLOOR(G12,5))))

This formula resides in cell G12. the result of the formula is 54, trying to use the Floor function to round it down to the nearest 5 which would be 50
 
Upvote 0
K12=2 in the formula which is 54

OK, so if K12 =2

Then it will NOT do the floor part

=IF(K12=1,PAY!$C$27,IF(K12=2,PAY!$D$27,IF(K12=3,PAY!$E$27,FLOOR(G12,5))))

IF(K12=2,PAY!$D$27 - then this is the bit thats calculated
so returns the value from PAY!$D$27

G12 is not used as K12 has to be FALSE and so NOT = 1,2, or 3
 
Upvote 0
If I understand you correctly... then yes.
IF(K12=2,PAY!$D$27 - then this is the bit thats calculated

The result of IF(K12=2 is true so it looks a sheet named "pay", specifically cell D27 which has the number "54" in that cell.
That value then is inserted in cell G12
 
Upvote 0
ok, so thats just a value that goes into G12
the floor() is not used - hence you get 54

Maybe you need floor on all those TRUE values , if thats what you want
IF(K12=2,PAY!$D$27
to
IF(K12=2,FLOOR(PAY!$D$27,5)
 
Upvote 0
Solution
etaf,

That worked....!!!!
Thank you very much....this is what the formula looks like now.

=IF(K12=1,FLOOR(PAY!$C$27,5),IF(K12=2,FLOOR(PAY!$D$27,5),IF(K12=3,FLOOR(PAY!$E$27,5))))

You guys are the best...!!!

VinceF
 
Upvote 0
you are welcome
HOWEVER,

you may want a false - if K12 does not = 1,2 or 3
then non are true and so a FALSE will be returned into the cell
is that what you want for a FALSE condition ?????

=IF(K12=1,FLOOR(PAY!$C$27,5),IF(K12=2,FLOOR(PAY!$D$27,5),IF(K12=3,FLOOR(PAY!$E$27,5), "what to put here ?, 0 or "" ")))
 
Upvote 0
a "FALSE" error message is ok as I have a conditional format in the cell(s) that changes the font color to white.

Thanks again
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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