+ Reply to Thread
Results 1 to 6 of 6

IF function to get the difference in two cells as answer, if criteria met

  1. #1
    Registered User
    Join Date
    05-22-2015
    Location
    Pakistan
    MS-Off Ver
    2010
    Posts
    3

    IF function to get the difference in two cells as answer, if criteria met

    Hello Guyz!

    I am new to this form and to Excel as well.

    I am making a trial balance and i want an IF formula that should be

    =IF(H26<E26,"E26-H26","") but instead of E26-H26 i want the cell to show the difference in numbers but it shows E26-H26.

    For instance if E26=100 and H26=60 , i want it to show the answer as 40 not "E26-H26".

    Please help me in this regard, Any help will be very appreciated.

  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,936

    Re: IF function to get the difference in two cells as answer, if criteria met

    Hi, welcome to the forum

    =IF(H26<E26,"E26-H26","") but instead of E26-H26 i want the cell to show the difference in numbers but it shows E26-H26.
    That is because you have the formula wrapped inside ""...this is turning it into text. Try this instead...
    =IF(H26<E26,E26-H26,"")
    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
    Registered User
    Join Date
    05-22-2015
    Location
    Pakistan
    MS-Off Ver
    2010
    Posts
    3

    Re: IF function to get the difference in two cells as answer, if criteria met

    Thank You FDibbins !

    It worked perfectly. I have been trying to do it for 2 hrs.

    Thanks once again.

  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,936

    Re: IF function to get the difference in two cells as answer, if criteria met

    Happy to help, gotta watch those ""

    If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  5. #5
    Registered User
    Join Date
    05-22-2015
    Location
    Pakistan
    MS-Off Ver
    2010
    Posts
    3

    Re: IF function to get the difference in two cells as answer, if criteria met

    Done...Both of them.

    Thank you...

    It was very helpful of you.

  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,936

    Re: IF function to get the difference in two cells as answer, if criteria met

    Thank you

+ 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. Multiple criteria arrays in countifs function resulting in incorrect answer
    By laurenmoney in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-28-2013, 12:57 PM
  2. [SOLVED] Excel function is returning undesired answer for blank cells
    By dcwandj in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2012, 12:14 PM
  3. Time difference between two cells using criteria
    By Devi S in forum Excel General
    Replies: 5
    Last Post: 04-17-2012, 07:12 AM
  4. [SOLVED] difference between two cells based on criteria in other cell
    By n9zez in forum Excel General
    Replies: 6
    Last Post: 11-17-2009, 04:34 PM
  5. Lookup Multiple Criteria return One answer
    By cbanks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2006, 04:10 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