+ Reply to Thread
Results 1 to 4 of 4

Automatically populate column based on dropdown input, dependend on number of rows

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    Automatically populate column based on dropdown input, dependend on number of rows

    Hi everyone,

    I've got a nice Excel challenge that I can't solve.

    I have a file where the year and quarter for the data have to be selected in a dropdowns (J1 and J2). Then, the columns 'YEAR' and 'QUARTER' should automatically be filled with the selections made. That I can manage, but then I want this to happen for every row that is populated, a number which can differ. For example, sometime the column "Country description" can have 5 entries, but i can also have 20. So I want the Year and quarter columns to, respectively have 5 and 20 rows filled with the Year and Quarter selections. So I'm looking for a way to have this adapt to the number of rows filled in in columns C - F.

    Example file attached If anyone can help me with this that would be great!

    Excel Year Quarter.xlsx

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Automatically populate column based on dropdown input, dependend on number of rows

    If you're just looking to populate column A (year) with the value stored in J1, then put this formula in A2 and fill down farther than you think you will ever need to go:

    =IF(C2<>"",$J$1,"")

    For column B, use this in B2 and fill down the same length:

    =IF(C2<>"",$J$2,"")

    - Moo

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Automatically populate column based on dropdown input, dependend on number of rows

    Thanks for the reply!

    I get an error message if I enter that formula. However, when I enter: =IF(C1<>"";$J$1) it does work. Small problem: when rows aren't filled in (so if column C=empty), Column A displays the word "FALSE", while I want it to simply not do anything and be blank. I'm sure I'm doing something wrong at this point?

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Automatically populate column based on dropdown input, dependend on number of rows

    Part 1: Yes, since you are in the Netherlands, your country settings use ; instead of , for argument separation... so that is why it works with ;

    Part 2: You left out the part of the formula that "blanks out" the cell if there is nothing in column C...

    My original formula (but using ';'): =IF(C2<>"";$J$1;"")

    - Moo

+ 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. Populate a column based on input from a textbox
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2012, 03:39 PM
  2. Using text box input to lookup number and replace based on user input into new column
    By harl3y412 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2011, 03:15 PM
  3. Populate rows in the sheet based on user input in the cell
    By omdkhaleel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2010, 10:48 AM
  4. Input dates automatically into rows, when given number of months.
    By jaganath in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-12-2010, 03:39 PM
  5. Automatically populate a list based on defined categories -- user input varies
    By NearClueless in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2009, 06:05 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