+ Reply to Thread
Results 1 to 13 of 13

Combining two formulas

  1. #1
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Combining two formulas

    Hi all,

    I have the two below formulas that work fine on their own. I would like to combine them:-

    {=IFERROR(INDEX(data!$L$2:$L$999,MATCH($A4&"|"&E$2,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0)),0)} - This returns a time that I want to round up to the nearest 15 minutes.

    =TIME(HOUR(REF), ROUNDUP((MINUTE(REF)/60)*4, 0) * 15, 0) - Replace REF with the cell that contains the above and I get the answer I'm looking for.

    If I just copy the first formula over the top of "REF", The formula works but doesn't return the correct value.

    I'm not sure exactly what's going on but if it anyone can help it will be greatly appreciated.

  2. #2
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Combining two formulas

    =IFERROR(TIME(HOUR(INDEX(data!$L$2:$L$999,MATCH($A4&"|"&E$2,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0)), ROUNDUP((MINUTE(INDEX(data!$L$2:$L$999,MATCH($A4&"|"&E$2,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0))/60)*4, 0) * 15, 0),0)

  3. #3
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: Combining two formulas

    Thanks but that returns the "the formula you have entered contains an error" message

  4. #4
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Combining two formulas

    Hmm. OK, when I get back in the office I'll get it sorted.
    Please remember to hit the Add Reputation for any member that has been helpful.

  5. #5
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: Combining two formulas

    Thank you!

    much appreciated.

  6. #6
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Combining two formulas

    Do you have some sample data I can work with? Particularly for the index/match you're running. Do you have a sample spreadsheet with sample data? Would be a huge help.

  7. #7
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: Combining two formulas

    I've attached my spreadsheet.The formula in question I've highlighted yellow.

    Basically I'd just like it to round up to the nearest 15 minutes.

    Thank you.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Combining two formulas

    Remember to enter as an array formula with Ctrl Shift Enter:
    =TIME(HOUR(INDEX(data!$L$2:$L$999,MATCH($A13&"|"&F$7,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0))),ROUNDUP((MINUTE(INDEX(data!$L$2:$L$999,MATCH($A13&"|"&F$7,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0)))/60)*4,0)*15,0)

    Edit:
    =IFERROR(TIME(HOUR(INDEX(data!$L$2:$L$999,MATCH($A11&"|"&F$7,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0))),ROUNDUP((MINUTE(INDEX(data!$L$2:$L$999,MATCH($A11&"|"&F$7,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0)))/60)*4,0)*15,0),0)

    Forgot you had the IFERROR on there. Apologies.

  9. #9
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: Combining two formulas

    Thanks, I just get 00:00 as a result though?

  10. #10
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Combining two formulas

    It's a cell reference issue. Put this in E8:

    =IFERROR(TIME(HOUR(INDEX(data!$L$2:$L$999,MATCH($A8&"|"&E$7,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0))),ROUNDUP((MINUTE(INDEX(data!$L$2:$L$999,MATCH($A8&"|"&E$7,data!$B$2:$B$999&"|"&data!$C$2:$C$999,0)))/60)*4,0)*15,0),0)

  11. #11
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: Combining two formulas

    Awesome you're a star.

    It's is greatly appreciated!

  12. #12
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Combining two formulas

    Happy to help!

  13. #13
    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,938

    Re: Combining two formulas

    try this...
    =IFERROR(TIME(HOUR(INDEX(data!$L$2:$L$999,MATCH($A8&"|"&E$7,INDEX(data!$B$2:$B$999&"|"&data!$C$2:$C$999,0),0))), ROUNDUP((MINUTE(INDEX(data!$L$2:$L$999,MATCH($A8&"|"&E$7,INDEX(data!$B$2:$B$999&"|"&data!$C$2:$C$999,0),0)))/60)*4, 0) * 15, 0),0)

    edit: oops need to refresh more often
    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

+ 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. combining two formulas
    By taker418 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-07-2013, 01:18 PM
  2. Combining IF formulas
    By donyc in forum Excel General
    Replies: 4
    Last Post: 09-09-2010, 05:42 PM
  3. combining IF formulas
    By donyc in forum Excel General
    Replies: 2
    Last Post: 09-08-2010, 09:31 AM
  4. combining formulas
    By ericc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2010, 08:26 PM
  5. Combining 2 Formulas
    By carl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-02-2006, 02:25 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