+ Reply to Thread
Results 1 to 9 of 9

Adding rows based on cell value & inputting values into a function

  1. #1
    Registered User
    Join Date
    04-27-2014
    Location
    Los Gatos
    MS-Off Ver
    Excel 2003
    Posts
    5

    Adding rows based on cell value & inputting values into a function

    I'm having a few minor issues with my spreadsheet.
    1. I don't know how to make the spreadsheet dynamically add and subtract rows based on a cell value. For example with my sheet I would like the value found in cell C4 to correspond to how many rows appear specifically up to 20. So If the value were to change to 10 I would like the spreadsheet to adapt accordingly and produce only 10 rows all across the spreadsheet from rows 9-28. I believe this would mess up my current sum function so If anyone knows what to do with that I'd appreciate it.

    2. My spreadsheet in it's current state applies to only one function. With my case it is x^2. I'm lost on how to make my spreadsheet apply to any function. I'll do my best to explain what I mean. If I were to place any function into cell B1, I would like to be able to plug in values and get a solution to the function. So lets say the function in B1 changes to X+1. I would like to be able to input values from lets say cell C9 into that function and get a solution.

    Any help would be greatly appreciated
    Thank You
    Excel Rienamm Sum.xlsx

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding rows based on cell value & inputting values into a function

    C5 gives the last cell you till you want to count. (see yellow cell).

    N4 gives you the result (sum of those cells). (see the green cell).

    I used the indirect formula in the green cell.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    04-27-2014
    Location
    Los Gatos
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding rows based on cell value & inputting values into a function

    Thanks so much for the reply but I'm not sure what to do with the yellow or green cell. I see that the yellow cell correctly indicates where the last row should be based on the value in C4. But the rows past that are still there. Is there any way to make the number of rows that appear = exactly the amount found in cell C4 ?

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding rows based on cell value & inputting values into a function

    I believe this would mess up my current sum function so If anyone knows what to do with that I'd appreciate it.

    The green cells refers to this question.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding rows based on cell value & inputting values into a function

    With an helpcolumn in column H and a filter (see the golden cells).

    You have to filter on "yes".

    See the attached file.

  6. #6
    Registered User
    Join Date
    04-27-2014
    Location
    Los Gatos
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding rows based on cell value & inputting values into a function

    I will take a look. Thanks

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Adding rows based on cell value & inputting values into a function

    Please find the attached sheet to see if this works as per your requirement.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  8. #8
    Registered User
    Join Date
    04-27-2014
    Location
    Los Gatos
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding rows based on cell value & inputting values into a function

    ^ I downloaded the spreadsheet and tried it out. But when I input a value in C4 for the number of intervals the amount of rows don't change.
    There are still 20 rows.

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Adding rows based on cell value & inputting values into a function

    The worksheet is working perfect at my end. May be it is due to the excel version. Make sure that macro is enabled in the worksheet by viewing the Macro Security on the worksheet. Moreover worksheet (I uploaded) shows row 18 where last record is visible.
    Right click on sheet1-->View Code. Can you see the code? If yes, copy the whole code. Then in your excel file(which you uploaded in your post#1), click on sheet1--> View Code and then paste the copied code in the code window and save your file as Excel Macro-Enabled Workbook. Also copy the formula in O4 to in O4 of your sheet. See if the code is running as expected.

+ 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] Adding rows based if cell value is 1 or 0
    By hbuzz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2014, 09:45 AM
  2. [SOLVED] Adding Rows Based on Cell Value
    By KevinTM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 11:12 AM
  3. Replies: 4
    Last Post: 06-28-2012, 07:08 AM
  4. Replies: 1
    Last Post: 06-09-2012, 11:04 AM
  5. Adding certain values based on a cell
    By folio in forum Excel General
    Replies: 6
    Last Post: 01-22-2005, 05:25 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