+ Reply to Thread
Results 1 to 6 of 6

Apply formula and functions for as long as the data is

  1. #1
    Registered User
    Join Date
    05-22-2014
    Posts
    23

    Apply formula and functions for as long as the data is

    Hi guys,

    A bit tricky to explain, but I have data across several worksheets which are all interlinked via vlookups/references. The data is across 6 columns and runs for multiple rows.

    My question is: Sometimes, I could have 100 lines of data, the other, 500. How can I make my 'working range' dynamically expand when I copy and paste in a new data set? (Everything is the same apart from the lines of data).

    At the moment, if I paste in a 120 line set of data after it had 540 lines in, I've got 420 rows of N/As and blanks messing up any filtering/subsequent work I want to do.

    Thanks

  2. #2
    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,933

    Re: Apply formula and functions for as long as the data is

    1 way...
    =if(your-formula=N/A,"",your-formula)
    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

  3. #3
    Registered User
    Join Date
    05-22-2014
    Posts
    23

    Re: Apply formula and functions for as long as the data is

    Not all the fields 'not in use' give N/A, some give 0. I have read a little about dynamic ranges, but wasn't sure if this was my solution here?

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

    Re: Apply formula and functions for as long as the data is

    I don't see what version of Excel you are using. If you are using Excel 2007 or later, then you can convert the lookup range to an Excel Table and give it a name like Table_Lookup or whatever makes sense. One of the many features of tables is that they know how big they are. So =VLOOKUP(A2,Table_Lookup,4,False) will look at exactly the right number of rows no matter how much data is added to or taken away from the table. You will also note that Table_Lookup makes a lot more sense than something like 'Sheet XYZ'!$A$2:$H$136.

    Here's some more information on tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel.

    For any version of Excel, you can also define a named dynamic range to cover the data. For information on how to make dynamic ranges, see this article: http://www.utteraccess.com/wiki/inde...Dynamic_Ranges.

    So suppose you create a named dynamic range called Lookup_Data, then you can use it like: VLOOKKUP(A2,Lookup_Data,4,False). If you set the named range up correctly, it will also grow and contract with the data.

    Tables are easier, but it's worth knowing how to set up a dynamic range; they come in handy for dynamic charting and sometimes you can overlay them over a pivot table result and then use the results of the pivot table as a data source for VLOOKUP or range for data validation or even another pivot table!
    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.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Apply formula and functions for as long as the data is

    Quote Originally Posted by dflak View Post
    You will also note that Table_Lookup makes a lot more sense than something like 'Sheet XYZ'!$A$2:$H$136.
    Not to me!

    If I see 'Sheet XYZ'!$A$2:$H$136 I immediately and instantly know where that's located.

    If I see Table_Lookup I might not remember where that is located and will have to go look for it.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Apply formula and functions for as long as the data is

    I suppose it's a matter of whether you want to know where something is or what it means. If you go to the name manager, the tables are listed and if you click on the table, it will take you to the page.

+ 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] How to apply nested IF functions in data validation
    By adriano.r.marques in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2015, 06:01 PM
  2. [SOLVED] How to apply correctly INDIRECT in array with long formulas
    By Franky alta in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-28-2015, 05:13 PM
  3. Apply formula to cells for new data
    By STINSON in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-16-2015, 04:54 PM
  4. [SOLVED] Apply formula through a range of data
    By meghs918 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-22-2015, 06:59 PM
  5. [SOLVED] =IF and =SUMIF formulas creating long long long data processing times.
    By comp in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 03-26-2014, 02:59 PM
  6. How to apply LEN, PMT, ABS functions to these problems
    By nonsenseone in forum Excel General
    Replies: 1
    Last Post: 09-24-2011, 12:20 AM
  7. Apply Functions to Rename File
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2009, 05:29 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