Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: What to do if formulas in cells conflict with results in oth

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

    Default

    I have the following formula in cell F2
    =IF(COUNTIF(A24:A28,E2),INDEX(D24:D28,MATCH(E2,A24:A28,0))*D2,0)

    And the following formula in Cell D2
    =IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))

    The number that the above formula produces in D2 is 30. The formula in F2 is supposed take the number that is produced in D2 and come up with 2,370, which is the correct answer. But it comes up with the incorrect answer of 2401.60.

    If I remove the formula from D2 and just type in the number 30 it works correctly. Any ideas on why the formula in cell D2 affects the outcome? Thanks

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi JRRT

    Are you sure the formula in D2 is really getting 30 and not 30.#### ? Try increasing the decimal places.




  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes, that is the problem is there a way to make it use the 30 instead of 30.4 that the formula produces.

  4. #4
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes, use the ROUND function.


    =ROUND(30.4,0)

  5. #5
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,025
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default

    On 2002-03-22 07:49, JRRT wrote:
    Yes, that is the problem is there a way to make it use the 30 instead of 30.4 that the formula produces.
    =IF(COUNTIF(A24:A28,E2),INDEX(D24:D28,MATCH(E2,A24:A28,0))*INT(D2),0)





  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The number in D2 will change is there a way to add it to the formula in D2 so that no matter wht number is in it it will round it? here is the formula. Thanks
    =IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))

  7. #7
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-22 07:57, JRRT wrote:
    The number in D2 will change is there a way to add it to the formula in D2 so that no matter wht number is in it it will round it? here is the formula. Thanks
    =IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))
    Use...

    =ROUND(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0)),0)

    or...

    =TRUNC(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0)))

    ...depending on which one is more appropriate for your application.


  8. #8
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    =ROUND(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))
    )

    Should work.


  9. #9
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Better make that...

    =ROUND(IF(B2="i",C2/2.5,IF(B2="d",C2/4,0)),0)

    ROUND's 2nd argument is required!

  10. #10
    New Member
    Join Date
    Mar 2002
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thank you very much it works great!

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
  •