+ Reply to Thread
Results 1 to 11 of 11

Dynamic Formula

  1. #1
    Registered User
    Join Date
    11-08-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    Dynamic Formula

    I have a set of formulas like this: =AVERAGEIFS(I2:I37, K2:K37, "Y") where the row number is variable (37). Tried playing a round with different formula options but to no avail.

    So I37 and K37 could be I254 and K254 respectively. I know how to calculate the 254 value but want to insert that calculation into the formula somehow. Make sense?

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Dynamic Formula

    I'm having trouble understanding. Could you upload a sanitized sample file showing what you're trying to accomplish?

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Dynamic Formula

    Why not this?

    =AVERAGEIFS(I:I,K:K,"Y")

  4. #4
    Registered User
    Join Date
    11-08-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    Re: Dynamic Formula

    The formula listed is static. If I want to change how many rows are included in the formula (either more or less than 37 used in the example) I'm wondering how to accomplish that. I tried "building the Rows" with a formula like this: =AVERAGEIFS(I2:I&(NamedRange*10+1)... In other words, use a variable to build I37 and K37

    Nothing really to upload

    Thanks for replying

  5. #5
    Registered User
    Join Date
    11-08-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    Re: Dynamic Formula

    I like the idea - it will mostly work. Assumes I want to use all rows in columns I & K though

    Thanks! I replied to this earlier but I don't see it - sorry if it shows up twice!

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Dynamic Formula

    Quote Originally Posted by JRF7928 View Post
    Assumes I want to use all rows in columns I & K though
    That's correct. If your ranges will be changing, then I assume that nothing is below the data that would affect the formula.

    You could also format your data into a table and refer to the entire table column (instead of the entire sheet column).

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Dynamic Formula

    AvgRng =OFFSET($I$2,0,0,COUNTA(I:I))
    CritRng ="OFFSET($K$2,0,0,COUNTA(K:K))"
    =AVERAGEIFS(AvgRng, CritRng, "Y")
    Ben Van Johnson

  8. #8
    Registered User
    Join Date
    11-08-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    Re: Dynamic Formula

    I'll need to review this one. Will require VBA it appears. You have one Range in Quotes and the other not.

    Thanks so much for the suggestion. I will check it out.

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Dynamic Formula

    I believe that the suggestion from post #7 was to create dynamic named ranges. This does not require VBA.

  10. #10
    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
    53,048

    Re: Dynamic Formula

    JRF7928 welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    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

  11. #11
    Registered User
    Join Date
    11-08-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    Re: Dynamic Formula

    Ok sorry. I don't know what I would change my thread title to say actually, so please edit as you see fit. There are 2 solutions prescribed by members but I don't know which is best actually but I will mark it 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. [SOLVED] dynamic chart values formula with dynamic starting point
    By Kramxel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2015, 03:30 AM
  2. [SOLVED] Dynamic formula, (copy from dynamic formula and ignore 0)
    By Kartoffelmos in forum Excel Formulas & Functions
    Replies: 42
    Last Post: 10-20-2014, 09:14 AM
  3. VBA - Updating Dynamic Line Chart & Inserting Dynamic Formula
    By bruno08102013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2014, 10:10 AM
  4. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  5. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  6. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  7. [SOLVED] Dynamic Range with unused formula messing up x axis on dynamic graph
    By cabybake@yahoo.com in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-02-2006, 04:10 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