+ Reply to Thread
Results 1 to 11 of 11

Help With The IF Function

  1. #1
    Registered User
    Join Date
    08-29-2009
    Location
    Lethbridge, Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Help With The IF Function

    Hi all,

    I am looking for a little bit of help with a problem I am having. I am developing worksheet for the purpose of calculating Short Rate earned premiums. I have the majority of what I need figured out but I am haveing some trouble with the IF function. What I am trying for is something like:

    IF(C4=D4,70,0)

    But for some reason the fuction won't work for me with "=", i can get it to work with ">=" or "<=" but if I use "=" it continues to come up false even when its true. Any insight would certainly be appreciated. Thanks.

    Last edited by will.osmond; 08-29-2009 at 05:52 PM. Reason: Solved

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Help With The IF Function

    Welcome to the forum.

    C4 and D4 are not exactly equal.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-29-2009
    Location
    Lethbridge, Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help With The IF Function

    Thanks for the welcome!

    I should have been more specific, its the value of cells c4 and d4 that should equal. And like I said it would work perfectly if i wanted it to be based on be greater then or less then but if the true or false is based on the values equaling then it always comes up false.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Help With The IF Function

    I haven't seen your cells C4 and D4.

    If the values were exactly equal, the formula would operate as you expect.

    Enter the same number in both cells and try it.

  5. #5
    Registered User
    Join Date
    08-29-2009
    Location
    Lethbridge, Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question Re: Help With The IF Function

    Ah ok well that was a little dense of me. I now understand the problem, the number being generated is a fraction, and even if I have the format set to show a whole number the IF function still sees the fraction and therefor the two can't be equal. It makes sense but also makes this more complicated. Is there anyway to get around that?

    I'll explain in a litte more detail what I'm trying to do and hopefully you can point me in the right direction. I'm trying to create a form which will calculate earned insurance premiums based on a short rate table. This table determins the amount earned based on how many days into the policy term the cancellation is. I figured out how to calculate the number of days easily enough with the YEARFRAC function but as I said this generates a fraction. I take the fraction, multiply it by 365 to get the days. But because the number generated is not a whole number it makes it impossible to use the IF function to automaticly determine the % to be used. I'm stuck as to how to get around this problem without having to put in a field for the agents to reenter the generated whole number on the form. That works but its a little bit of an ackward way of doing it. Is there any way to get the generated day to be treated as a whole number?

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Help With The IF Function

    Can you create example workbook and upload it?

    As far I see you'll need round function (wich can give you rounded numbers) but more likely lookup function. But I'm not allowed by law to read people's mind so some example with desired inputs and outputs would be nice
    Never use Merged Cells in Excel

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Help With The IF Function

    You can round one or the other (or both) to the nearest whole number:

    =IF(ROUND(C4,0) = D4, 70, 0)

  8. #8
    Registered User
    Join Date
    08-29-2009
    Location
    Lethbridge, Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Thumbs up Re: Help With The IF Function

    Quote Originally Posted by shg View Post
    You can round one or the other (or both) to the nearest whole number:

    =IF(ROUND(C4,0) = D4, 70, 0)
    This is exactly what I needed and indeed works perfectly to fix my problem. Thank you so much! Now its just a matter of data entry and asthetics.

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Help With The IF Function

    Can you please make thread [solved]?

  10. #10
    Registered User
    Join Date
    08-29-2009
    Location
    Lethbridge, Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help With The IF Function

    Quote Originally Posted by zbor View Post
    Can you please make thread [solved]?
    Thread set to solved.

  11. #11
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Help With The IF Function

    Ty

    Be free to post new questions

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1