+ Reply to Thread
Results 1 to 11 of 11

Trouble combining two formulas into one

  1. #1
    Registered User
    Join Date
    10-12-2008
    Location
    Port Pirie
    Posts
    53

    Trouble combining two formulas into one

    The first formula

    =IF(B7="na",0,((C7-B7)*24))

    I need to add

    =IF(C7-B7)*24>6,-0.5

    to get something like this

    =IF(B7="na",0, ((C7-B7)*24))>6 -.5 otherwise (C7-B7)*24))

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Trouble combining two formulas into one

    Try:
    =IF(((C7-B7)*24)>6,-0.5,IF(B7="na",0,(C7-B7)*24))
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  3. #3
    Registered User
    Join Date
    10-12-2008
    Location
    Port Pirie
    Posts
    53

    Re: Trouble combining two formulas into one

    Thanks for your help, unfortunately it didn't work. The result is -.50

    The formula calculates the hrs between 7 am and 4 pm =9 hrs, as this number is greater than 6 hrs I need it to subtract.5 hrs. Thus giving me 8.5
    Now it is giving me #Value! in the cells containing na

  4. #4
    Registered User
    Join Date
    10-12-2008
    Location
    Port Pirie
    Posts
    53

    Re: Trouble combining two formulas into one

    here is a image of the workbook Example.png

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Trouble combining two formulas into one

    Can you upload a small sample workbook? Not a picture, pls?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Registered User
    Join Date
    10-12-2008
    Location
    Port Pirie
    Posts
    53

    Re: Trouble combining two formulas into one

    Can't see where the insert workbook button is

  7. #7
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Trouble combining two formulas into one

    Is giving you error as you are trying to make calcualtion on Text(na) and empty cell.
    Try:
    =IFERROR(IF(((C7-B7)*24)>6,((C7-B7)*24)-0.5,IF(B7="na",0,(C7-B7)*24)),"")

  8. #8
    Registered User
    Join Date
    10-12-2008
    Location
    Port Pirie
    Posts
    53

    Re: Trouble combining two formulas into one

    Quote Originally Posted by RobertMika View Post
    Is giving you error as you are trying to make calcualtion on Text(na) and empty cell.
    Try:
    =IFERROR(IF(((C7-B7)*24)>6,((C7-B7)*24)-0.5,IF(B7="na",0,(C7-B7)*24)),"")
    Cheers dude, formula works, only one problem now when I do auto sum for total hours for week #Value appears, is this due to the text in the new fromula as it wasn't a problem before

  9. #9
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Trouble combining two formulas into one

    Change "" to 0
    =IFERROR(IF(((C7-B7)*24)>6,((C7-B7)*24)-0.5,IF(B7="na",0,(C7-B7)*24)),0)

    Please add reputation.

  10. #10
    Registered User
    Join Date
    10-12-2008
    Location
    Port Pirie
    Posts
    53

    Re: Trouble combining two formulas into one

    Thanks Rob Reputation has been left, thank you for your assistance.

  11. #11
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Trouble combining two formulas into one

    You are welcome.

+ 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. trouble combining LEFT and MATCH
    By jakeopolis in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 09:48 AM
  2. Having trouble combining AND and IF
    By hammerb in forum Excel General
    Replies: 2
    Last Post: 10-05-2011, 10:24 AM
  3. Trouble Combining Functions
    By jturenne in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-06-2009, 01:35 PM
  4. Trouble Combining Codes
    By dogsoul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2009, 02:43 AM
  5. [SOLVED] Having trouble combining 4 cells with formulas into one cell formu
    By jimtmcdaniels in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-18-2005, 09:00 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