+ Reply to Thread
Results 1 to 5 of 5

creating dynamic conditional statement for averageifs

  1. #1
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    creating dynamic conditional statement for averageifs

    this should be an easy one for you pros. I have an averageifs statement that I need to have a dynamic statement created. I am pretty sure I need to use INDIRECT but can't quite figure out how to put it together.

    here's the desired statement:
    Please Login or Register  to view this content.
    Where 1500 is held in cell B7 and 2750 is held in cell B6. What I can't figure is how to build the ">=B7" and "<=B6" statements. I've tried using indirect:

    Please Login or Register  to view this content.
    but get a Div/0 error. I'm assuming that I need to have the quote at the beginning and end of the statement but not sure how to put them in.

    Thanks in advance.
    Last edited by olsoniv; 02-15-2011 at 05:24 PM. Reason: Clarification.

  2. #2
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    Re: creating dynamic conditional statement for averageifs

    searching around, I found a couple posts with indirect references in them. I tried adding a ' at the beginning and end of the indirect statement
    Please Login or Register  to view this content.
    but still no luck...

  3. #3
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    Re: creating dynamic conditional statement for averageifs

    Maybe this wasn't such an easy problem?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: creating dynamic conditional statement for averageifs

    No need for INDIRECT here - be wary of using Volatiles (esp. in large models)

    Please Login or Register  to view this content.
    in essence the >= and <= criteria values are "strings" so you use & to concatenate the constant (operator) with the variable (contained in a cell)

    ">="&B7 becomes ">=1500"

  5. #5
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    Re: creating dynamic conditional statement for averageifs

    HA! Classic case of my making something more complicated than it actually needed to be. Thanks again DonkeyOte...you are awesome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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