Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: IF Statement; result incorrect

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    =IF(D25>240,240,0)
    How do I format the cell so that it comes up with 240? I currently have it formatted as Custom, m and t comes up with 8 instead of 240. 240 represents months.

    Cell D25 has the following formula:
    =DATEDIF(D22,D23,"M")

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    North Alabama, USA
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-01 11:38, minnie wrote:
    =IF(D25>240,240,0)
    How do I format the cell so that it comes up with 240? I currently have it formatted as Custom, m and t comes up with 8 instead of 240. 240 represents months.

    Cell D25 has the following formula:
    =DATEDIF(D22,D23,"M")
    Sound like you want the NUMBER of months, not the month digit. "m" is for dates, you are asking for a number (I think).

    Hope this helps!

    Rocky

    <h6>"Be not the first by whom the New are try'd,
    Nor yet the last to lay the Old aside."
    Alexander Pope (1688-1744).</h6>

  3. #3
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,060
    Post Thanks / Like
    Mentioned
    38 Post(s)
    Tagged
    8 Thread(s)

    Default

    On 2002-05-01 11:38, minnie wrote:
    =IF(D25>240,240,0)
    How do I format the cell so that it comes up with 240? I currently have it formatted as Custom, m and t comes up with 8 instead of 240. 240 represents months.

    Cell D25 has the following formula:
    =DATEDIF(D22,D23,"M")
    What is m and t?

    Your formula

    =IF(D25>240,240,0)

    comes up with 8?


  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Southfield,MI USA
    Posts
    2,312
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Minnie,

    I believe you want to format your cell with a number format.

    I realized that the number 240 appears as the value "8" in a cell when formated with the custom "M" format - this is because 240 is the serial number for the date 8/27/1900 - the month of that date being 8.

    Adam

  5. #5
    Board Regular sen_edp's Avatar
    Join Date
    Mar 2002
    Location
    Hellas
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hello Minnie

    format the cell with the formula eith a number format.
    It works


    Andreas



Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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