+ Reply to Thread
Results 1 to 8 of 8

Help extending automatic (indirect) formula

  1. #1
    Registered User
    Join Date
    07-17-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Help extending automatic (indirect) formula

    Hello

    I have been working on a formula which will sum all of the numbers for a set of cells whose column and row identifiers are automatically calculated to match a set of criteria inputted into some other cells.

    I have this working but I want to roll it out to other sheets (same design) where the number of cells to be summed will be different. As this means some of the INDIRECT() references are now blank, it throws up an error since the result of the indirect function returns N/A, which cannot be summed. This is fixable if I remove these statements from the overall formula, but this defeats the purpose of being able to have a single formula that fits all.

    Is there anything that can be done to improve this?

    Here is the code:
    Please Login or Register  to view this content.
    The idea here is that:
    - column AH is where I input the content so, if it is blank then it would add nothing to the sum.
    - column AJ contains a lookup of the matching column, eg $M
    - if either AH is blank, the blank in column AJ will add nothing to the sum (ie, ignoring it)

    I know that I can use SUM , which I did have but wondered if it was what was causing the error and have not had time to change it back yet

    Thanks for any help

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Help extending automatic (indirect) formula

    Welcome to the forum.

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Help extending automatic (indirect) formula

    With a sample file where we could see the formulas in AH and have some data to work with, it might be possible to simplify the formula.

    With what you have given us so far, you could either replace the double quotes with zero's or enclose the whole thing in SUM() and replace the plus signs with commas.

  4. #4
    Registered User
    Join Date
    07-17-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Help extending automatic (indirect) formula

    Sorry guys,

    Here is the sample file. The column positions have changed but the rest is the same. I have removed the names column to protect the inocent
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-17-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Help extending automatic (indirect) formula

    Brilliant!! I replaced the quotes with 0's and it works. Only problem now is how to calculate the value in column B which errors if there are blanks.

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Help extending automatic (indirect) formula

    Try this formula in A5 of your sample file and fill down, see if it helps.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    edit:-

    For the MAX in column B, try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That should allow you to remove the INDIRECT formulas and the ADDRESS formulas in columns Y and Z
    Last edited by jason.b75; 07-18-2019 at 04:18 AM.

  7. #7
    Registered User
    Join Date
    07-17-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Help extending automatic (indirect) formula

    How did you do that?????
    Please can you walk me through the function as it is WAY simpler than what I spent 3 hours on

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Help extending automatic (indirect) formula

    In normal use, SUMIF looks at a list of items (D3:V3 in your sample sheet) and compares them to a specifed criteria (X5). If any item(s) in the list match the criteria, then the corresponding value(s) in the sum range (D5:V5) are totalled.

    SUMIF as a single function only works by comparing a single criteria to the list of items, nesting it in SUMPRODUCT allows multiple criteria (the second list in X5:X11) to be used, giving the cumulative total as the end result.

+ 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. Extending Formula
    By samchen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2017, 12:01 PM
  2. [SOLVED] Extending formula
    By Medicalstudent in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-23-2016, 07:37 AM
  3. Extending formula
    By lonesoac0 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2016, 03:25 PM
  4. extending formula
    By jackhays in forum Excel General
    Replies: 1
    Last Post: 02-10-2015, 04:27 AM
  5. Replies: 5
    Last Post: 01-22-2015, 06:56 AM
  6. [SOLVED] Automatic copying to another sheet using indirect
    By pauldaddyadams in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-05-2014, 11:51 AM
  7. Replies: 3
    Last Post: 11-22-2012, 11:19 PM

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