![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Christy
Posts: 13
|
Hello All,
I need a formula in cell U24 that will look at the result in cell J16 and, if it sees a fraction, it will divide only the fraction part of the number into 42. Here's an example: cell J16 contains 12.6 cell U24 will divide 42 by .6, round that result up to nearest whole number and display 26 If cell J16 contains a whole number with no decimal, cell U24 will display 0. Thank you so much for any help you can provide! ~Christy |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
The following seems to give the result you want, but I'd test it with other values also: -
=IF(INT(J16)<>J16,ROUNDUP(42*(J16-INT(J16)),0)) |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=IF(J16-INT(A16),ROUND(42/(J16-INT(J16)),0),0) I get 70, not 26 when J16 is 12.6. Is that wrong. Aladin |
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Aladin, I think Mudface is on the right track. It appears she meant to say 42 * 0.6, not 42/0.6.
Take care
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
#6 |
|
New Member
Join Date: Feb 2002
Location: Christy
Posts: 13
|
Thank you so much! I'm sorry for the mistake, it *is* supposed to be 42 *.06 and Mudface's answer works perfectly - Thank you all soooooo much!
~Christy |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|