+ Reply to Thread
Results 1 to 7 of 7

Need help adding another condition to IF formula

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    2007
    Posts
    68

    Question Need help adding another condition to IF formula

    We are dealing with times and number of hours here.

    Here is what I have in cell I2
    =IF(F2="",0,(IF((($G2-$F2)*1440)/60<=0,((($G2-$F2)*1440)/60)+24,(($G2-$F2)*1440)/60))-0.5)

    However, if G2-F2 is less than E2-D2, then I don't want the -0.5 at the end.

    Here's an example
    D2 E2 F2 G2 H2 I2
    8:00 18:30 15:30 18:30 CU 2.50

    In that example, G2-F2 is less than E2-D2. With the formula the way it is, I get 2.50 hours in I2. Since G2-F2 is less than E2-D2, my answer in I2 needs to be 3.00 hours. Everything I do is messing things up and I get the warning that says there is an error in my formula. Please help.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Need help adding another condition to IF formula

    Maybe this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Does that do what you want?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    08-02-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    2007
    Posts
    68

    Re: Need help adding another condition to IF formula

    Quote Originally Posted by Ron Coderre View Post
    Maybe this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Does that do what you want?
    No. That gives me #VALUE! .

  4. #4
    Registered User
    Join Date
    08-02-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    2007
    Posts
    68

    Re: Need help adding another condition to IF formula

    Book3.xlsm

    Sorry, here is spreadsheet I am working with.

  5. #5
    Registered User
    Join Date
    08-02-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    2007
    Posts
    68

    Re: Need help adding another condition to IF formula

    Monday morning check for new replies. Any help will be appreciated.

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Need help adding another condition to IF formula

    When I entered the formula I posted (above) in your workbook:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    it returns the value you're looking for: 3:00

    Are you looking for something else?

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need help adding another condition to IF formula

    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Adding an IF condition into an existing formula.
    By dmejia174 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2013, 07:33 PM
  2. [SOLVED] Help for if condition formula result only either hit or miss from mulitple condition
    By breadwinner in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2013, 07:29 AM
  3. Adding a condition to a formula to filter data
    By MartinHK in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-16-2013, 03:53 PM
  4. Adding condition to existing formula
    By KINNEY0201 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-16-2010, 01:42 PM
  5. Index Formula - adding a range condition
    By Henry c in forum Excel General
    Replies: 2
    Last Post: 04-29-2010, 10:19 AM

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