+ Reply to Thread
Results 1 to 6 of 6

Create Varying Table Length Detremined by User Input

  1. #1
    Registered User
    Join Date
    10-03-2017
    Location
    Morgantown, West Virginia
    MS-Off Ver
    Excel 2016
    Posts
    3

    Create Varying Table Length Detremined by User Input

    Hi everyone,

    I am trying to make a table that will have as many rows as a certain cell value. I have a cell that someone could input a number. In my case it is the number of payments for a loan. I have a couple if statements to change the cells around if they are paying by monthly or monthly. The code is below. However I have my table set up for 360 payments, which would be a thirty year loan. I want to make the table regenerate itself if someone would like a longer or shorter loan.

    =IF($F$11="No",(IF(DATE(YEAR(K10),MONTH(K10)+1,DAY(K10))<=DATE(YEAR($F$10),MONTH($F$10)+$F$8,DAY($F$10)),DATE(YEAR(K10),MONTH(K10)+1,DAY(K10)),"Payment is Over")),IF(DATE(YEAR(K10),MONTH(K10),DAY(K10)+14)<=DATE(YEAR($F$10),MONTH($F$10),DAY($F$10)+($F$8*(14))),DATE(YEAR(K10),MONTH(K10),DAY(K10)+(14)),"Payment is Over"))

    F11 is either Yes or No. This is the answer to is this a bimonthly payment.
    K10 is the previous payment date.
    F10 is the payment start date.
    F8 is the user input for the length of the loan.
    The formula either increases the month by 1 or increases the days by 14 depending on if it is a bimonthly payment or not.

    The problem is in the false condition of the if statements. I did not know what to put so I made it a text to let someone know that the payment is already over, however I would like the cells after this to have no value. and the table end at the ending date.

    Any help would be appreciated as I am new to using functions in Excel.

    Thanks,

    Kody

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Create Varying Table Length Detremined by User Input

    You can't regenerate your table with a formula, you would need VBA to do this, but how about using conditional formatting.

    Format the cells to have borders thru a certain number and not borders if empty. This will give the appearance of a table growing or shrinking.

    How does this sound?
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    10-03-2017
    Location
    Morgantown, West Virginia
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: Create Varying Table Length Detremined by User Input

    that sounds great! how would I use conditional formatting to do that? I still don't know how to get the values after the date to show up empty using this IF statement. How would I get the false portion of the IF statement to make a blank cell? Thanks!

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Create Varying Table Length Detremined by User Input

    How this? Change the value in J1.

    Look at the formula in A2 and you'll see the "" are for the false part of the formula.

    In this case, in column A the formula runs down thru row 41

    Conditional Formatting
    • Highlight applicable range >> =$A$2:$F$41
    • Home Tab >> Styles >> Conditional Formatting >> New Rule
    • Select a Rule Type: Use a formula to determine which cells to format
    • Edit the Rule Description: Format values where this formula is true: =ROW()-1<=$J$1
    • Format… [Number, Font, Border, Fill]
    • OK >> OK
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-03-2017
    Location
    Morgantown, West Virginia
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: Create Varying Table Length Detremined by User Input

    You nailed it! Thank you!

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Create Varying Table Length Detremined by User Input

    Glad to hear now you have a solution to work with and you're welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Message box with user input and varying answers
    By matt87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2017, 11:03 AM
  2. Create a table that is sized based on user input in Excel?
    By hemagala in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-13-2015, 06:48 AM
  3. Length of User Input
    By sperry2565 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2013, 05:19 PM
  4. Convert freeform user input and write to a fixed length text file
    By vijaymohan10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2013, 04:44 AM
  5. [SOLVED] Take date from string and input into varying column length
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-26-2013, 10:55 AM
  6. user input diameter and length to part number
    By razali in forum Excel General
    Replies: 1
    Last Post: 12-14-2005, 03:20 PM
  7. Create a table based on user input?
    By S. Anders in forum Excel General
    Replies: 0
    Last Post: 02-09-2005, 09:36 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