+ Reply to Thread
Results 1 to 6 of 6

How to show a zero in a cell when using an IF statement comparing cells

  1. #1
    Forum Contributor
    Join Date
    05-04-2008
    Posts
    103

    How to show a zero in a cell when using an IF statement comparing cells

    I have a balance sheet that uses the following formula:

    Please Login or Register  to view this content.
    Ok with this formula if M39 is $200.00 and M40 is the amount advanced $242.00 then cell M43 should show that the employee owes payroll $42.00. But it does not show anything. It will only show what payroll owes employee if M39 is $350.00 and M40 is $242.00 then payroll owes employee $108.00 and it shows that. How can I get M43 to show the amount when the employee owes payroll? thank you.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to show a zero in a cell when using an IF statement comparing cells

    I think you have your logic the wrong way round...
    =IF(M40>M39,M39-M40,0)
    0r
    =IF(M40<M39,0,M39-M40)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    05-04-2008
    Posts
    103

    Re: How to show a zero in a cell when using an IF statement comparing cells

    Maybe I am not putting it in the cell correctly. But if I put in the first part of the formula that you gave me then the Employee is owed money from payroll works. But if I put in the complete formula adding the second part i get a #VALUE then nothing works. Thank you for the help.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to show a zero in a cell when using an IF statement comparing cells

    M
    39
    200
    40
    242
    41
    42
    43
    -42
    44
    42


    M43=IF(M40>M39,M39-M40,0)
    M44=IF(M40>M39,M40-M39,0)

    If you still have a problem, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  5. #5
    Forum Contributor
    Join Date
    05-04-2008
    Posts
    103

    Re: How to show a zero in a cell when using an IF statement comparing cells

    That worked perfectly. Thank you very much for your patience and help.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to show a zero in a cell when using an IF statement comparing cells

    Happy to help, thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] CF Statement Formula to show N/A in cell
    By SVTF in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2014, 10:56 PM
  2. If Then statement comparing value in one cell vs. the values in a range of cells
    By Excel_Tony in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-07-2014, 08:21 AM
  3. How to use an if statement to show a name in a cell
    By Jeff148 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-05-2014, 10:49 AM
  4. Force IF statement to show on new line (ALT+ENTER) in cell
    By lukestkd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2013, 07:54 PM
  5. Nested IF statement comparing value1 against multiple cells?
    By MJSlattery in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2012, 06:12 PM
  6. If statement Don't Show Data if cell is empty
    By PacE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2008, 04:57 PM
  7. [SOLVED] Comparing Cell Contents using a Case statement
    By todd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2005, 04:35 PM

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