+ Reply to Thread
Results 1 to 9 of 9

Need Help Combining/Nesting 2 Formulas

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    San Jose, California
    MS-Off Ver
    Excel 2019
    Posts
    13

    Need Help Combining/Nesting 2 Formulas

    Hi, I need assistance combining or nesting two formulas.
    I am pretty new to Excel and writing formulas, and although I was able to find and modify each formula to do what I need them to do independently, I have had no luck with trying to put the two of them together in a single formula.

    Here are each of the formulas, in their individual working states:

    =IF(ISREF(INDIRECT("'Cost Summary'!A1")),INDIRECT("'Cost Summary'!A1"),"")
    AND
    =SUMIFS(S6:S1000,J6:J1000,"Non-Billable",N6:N1000,3004)

    The second formula (the SUMIFS) currently resides on the "Cost Summary" tab in my workbook, and works as it should there.
    The first formula (with the INDIRECT references in it), is on the first tab in my workbook and also works as it should.

    My goal is to have the first formula combined with the second one so that when I create (from scratch each month) the "Cost Summary" tab, the data from the "Cost Summary" tab will automatically be filled into those cells which contain the "combined version" of the formula on the first tab of my workbook.

    I am not sure if the SUMIFS should replace the IF, or if the SUMIFS would be nested inside of the "()'s" after INDIRECT.

    I also know that some part (or all) of the SUMIFS formula will need to replace the !A1, but try as I might, I have not been able to figure it out.

    ... any help is greatly appreciated. Thank you.
    Attached Files Attached Files
    Last edited by Justin_time; 03-12-2015 at 06:05 PM. Reason: Uploaded a Sample Workbook

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Need Help Combining/Nesting 2 Formulas

    You should post a sample workbook.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    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,939

    Re: Need Help Combining/Nesting 2 Formulas

    Not really sure what you want, but perhaps...
    =IFERROR(INDIRECT("'Cost Summary'!A1"),SUMIFS(S6:S1000,J6:J1000,"Non-Billable",N6:N1000,3004),"")

    Or even...
    IFERROR(SUMIFS(S6:S1000,J6:J1000,"Non-Billable",N6:N1000,3004),"")

    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.
    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

  4. #4
    Registered User
    Join Date
    10-24-2012
    Location
    San Jose, California
    MS-Off Ver
    Excel 2019
    Posts
    13

    Re: Need Help Combining/Nesting 2 Formulas

    Thank you mikeTRON & Ford. I have gone back to the original post and uploaded a sample workbook, with a couple of comments added inside of it to try and explain what I am trying to accomplish.

  5. #5
    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,939

    Re: Need Help Combining/Nesting 2 Formulas

    I will work on a quick formula for you, but why are youy running that INDIRECT test in teh 1st place? It seems unrelated to what you want to sum

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

    Re: Need Help Combining/Nesting 2 Formulas

    OK, based on what you have in J, you only have Billable and Non-Billable, but (IF I understand, you want to sum Billable PLOTS"
    Likewise, I dont see where you are showing a Prod-Code for that criteria?

    Based on the formula you have in Cost sheet...
    =SUMIFS(S6:S1000,J6:J1000,"Billable",N6:N1000,3002)
    You are looking for Billable (OK I get that, that word can be extracted from K&W A10. But where does the 3002 come from?

    Regarding your need for INDIRECT "Because the Cost Summary tab is generated on the fly each month", why not just keep that sheet and juct copy/paste the new data onto it, possible at the bottom of the existing data? This way, you will have all your data and can run historic summaries if needed. the SUMIFS can be modified to include dates

  7. #7
    Registered User
    Join Date
    10-24-2012
    Location
    San Jose, California
    MS-Off Ver
    Excel 2019
    Posts
    13

    Re: Need Help Combining/Nesting 2 Formulas

    Hi Ford. I have very limited knowledge of Excel formulas, and in my searching of the internet, the INDIRECT formula seemed to be what I need.

    I am trying to write a formula that will stay in the same cell on the K&W tab, and each month as the cost summary tab is generated, the formula will look at the cost summary tab and fill in the data I need automatically. In my example, if I rename the cost summary tab to something else, the word "Test" in cell J8 will disappear. Once the cost summary tab is present in the workbook, the contents of the cell that it points to will appear right on que.

    What I would like to appear in cell C10 on the K&W tab is the sum from the cost summary tab for column "S" once the two criteria from columns "J" and "N" are met with the SUMIFS formula. I am looking for the total number of Sq. Ft. for the Billable Plot items (criteria "Billable" from column "J"), and the product code 3002 (criteria 3002) from column "N". The answer that I am looking for is = 4587.

    It seemed simple enough to me that the two formulas that I already have could be put together in a single formula to do what I want (which is to wait for the cost summary tab to appear, then use SUMIFS to extract the numbers that I need).

    As it is, I have to filter the data on the cost summary tab by columns "J" & "N" and then get my totals from column "S" to fill in the appropriate cells on the K&W tab. I am trying to automate this process.

  8. #8
    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,939

    Re: Need Help Combining/Nesting 2 Formulas

    OK to answer your question directly, perhaps this...

    =IF(ISREF(INDIRECT("'Cost Summary'!A1")),SUMIFS(S6:S1000,J6:J1000,"Non-Billable",N6:N1000,3004),"")

    Or maybe even...
    =IFERROR(SUMIFS(S6:S1000,J6:J1000,"Non-Billable",N6:N1000,3004),"")
    (which I mentioned before)

  9. #9
    Registered User
    Join Date
    10-24-2012
    Location
    San Jose, California
    MS-Off Ver
    Excel 2019
    Posts
    13

    Re: Need Help Combining/Nesting 2 Formulas

    Good morning Ford. Unfortunately I am still doing a poor job of explaining what I am trying to do. Neither of the two formulas above do what I need.

    The first one you provided I believe that I already had tried on my own. The problem with it I believe lies with the transition from referencing cell "A1" on the Cost Summary tab to instead referencing the SUMIFS result which should be pulled from the Cost Summary tab. The formula as you give above, with the comma between ...A1")),SUMIFS... has the indirect part of the formula looking for cell A1 on the Cost Summary tab and returning its contents, and the SUMIFS formula is returning its results from columns "J" "N" & "S" on the K&W tab. I don't want the contents of cell A1 - it is only in this workbook for me to test if and how the INDIRECT formula works pulling data from a tab called Cost Summary when the tab is either present or missing.

    I now need to remove the A1 cell reference and replace it with the result of the SUMIFS formula to return the number 4,587 from the Cost Summary tab.

    The second formula is still only referring to the tab on which it is written. If the second formula could be written in a cell on the K&W tab, and just sit there waiting until the Cost Summary tab is added to the workbook, and then pull the result, that would be perfect.

    The only information that I have found online about writing a formula that refers to a tab that has not been created in a workbook yet mentions the INDIRECT formula. I don't fully understand what the INDIRECT formula does exactly. If there are other suggestions as to how accomplish this, I am open to any and all suggestions.

    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. Need help nesting some formulas
    By jceg316 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2014, 12:28 PM
  2. Nesting If formulas
    By lmennucci in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2013, 04:12 PM
  3. [SOLVED] Nesting Formulas
    By colbyjack in forum Excel General
    Replies: 10
    Last Post: 05-31-2012, 05:23 PM
  4. Nesting of Formulas
    By mttlltt75 in forum Excel General
    Replies: 1
    Last Post: 06-05-2009, 11:12 AM
  5. Nesting formulas
    By msbing916 in forum Excel General
    Replies: 2
    Last Post: 07-30-2007, 11:13 AM

Tags for this Thread

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