+ Reply to Thread
Results 1 to 4 of 4

Auto-adjust # of rows in a column that have a formula based on adjacent column data?

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    Cali
    MS-Off Ver
    Excel 365
    Posts
    62

    Auto-adjust # of rows in a column that have a formula based on adjacent column data?

    So I have a table of transactions with category, description, data, amount, etc.

    I am using UNIQUE() on another sheet to generate only the unique va balues from that list of transactions as categories repeat many times (many lines for Groceries, many for gas, for gym, etc etc). I am actually using UNIQUE(IFERROR(FILTER())) to filter out lines from the first table that omicanly fall between certain reference dates (IE give me all unique categories from 5/1/18 to 5/31/18).

    Once I have my unique list on another sheet, I am using a SUMIFS() to sum all transactions against each unique category (this is a budgeting sheet).

    What I am struggling with is every month, the list of unique values is a different length. Basically I am creating a live dynamic pivot table (I will do some other calcs off this data afterwards), but because one month might have 7 unique categories but the next month could have 13 or 12 or 20, I need the adjacent column which has the SUMIFS() formula to scale up and down based on the unique category column. Is there a way to tie those two together dynamically so if the UNIQUE() function returns 15 lines (A5-A20 for example), then the SUMIFS() will fill B5-B20? Obviously I can just populate a "fill down" in the B column for like 100 rows, but I want it to be dynamic so I can have a total line at the bottom. Again, this is basically recreating a pivot table but for some formatting and later calc reasons I have not gotten a pivot table to work as I would like. Can this be done without scripting?

    Any thoughts?

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Auto-adjust # of rows in a column that have a formula based on adjacent column data?

    I assume you have Excel as indicated in your profile.

    You are trying to extend the formulas next to a unique list to match the number of rows in the unique list. The best way I find to get a unique list is to use a pivot table. It is easier than the manual steps of filtering. It's the same problem after the filtering. Other than guessing how many rows might be returned, I can't see a way of doing this without VB.

    I suggest putting the total line ABOVE the pivot table so at least it is in a consistent location. Also, if you don't want to address the entire range of SUMIF formulas, you can used a named dynamic range to "cover" only those that matter.

    I have no idea how your data is organized by maybe helper columns and pivot table formulas might accomplish the same thing.

    Here is some information on named dynamic ranges: http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    08-10-2011
    Location
    Cali
    MS-Off Ver
    Excel 365
    Posts
    62

    Re: Auto-adjust # of rows in a column that have a formula based on adjacent column data?

    Thanks for the response mate. Actually looking to do this on google sheets. Was thinking the arrayformula() deal would cause the autofill down like when adding data via a form, but so far no dice.

    Maybe I need to be looking specifically into how to manipulate pivot tables more, but I've always had trouble running formulas against the pivot table (IE doing a fill down keeps the reference to the original pivot table cell instead of transferring the reference down, and everytime I refresh data the format reset). Also I do prefer the pivot table format in excel over google sheets but this doc has to live in sheets (personal budget).

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Auto-adjust # of rows in a column that have a formula based on adjacent column data?

    I won't say anything bad about Google Sheets, so I won't say anything at all . Other than displaying the data and allowing data entry, they fall well short of the mark compared to "regular" Excel.

+ 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. [SOLVED] Auto fill column based on adjacent column
    By brncfan7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2017, 07:50 PM
  2. [SOLVED] macro to autofil formula based on number of rows on adjacent column
    By kramtelbuab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2013, 08:28 PM
  3. [SOLVED] Auto Adjust Stacked Column Need to Adjust Legend
    By tbren in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-29-2013, 01:56 PM
  4. Extracting data from one column based on value from an adjacent column
    By CountySurveyor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-10-2012, 10:32 AM
  5. [SOLVED] VLOOKUP formula that will relatively adjust rows by a block of 8 rows with absolute column
    By DPKologie in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 09-02-2012, 04:00 AM
  6. auto adjust rows and column on content name
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2011, 05:37 AM
  7. [SOLVED] Auto Fill Column with Date based on rows in other column
    By JOUIOUI in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2006, 01:35 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