+ Reply to Thread
Results 1 to 4 of 4

Averaging and STDev based upon conditions

  1. #1
    Registered User
    Join Date
    11-20-2007
    Posts
    2

    Averaging and STDev based upon conditions

    Hi all,

    This may be very simple but I cant think of a way of doing!

    I would like to get an average and STDev of a column based around the conditions of another column. I have one column with Country names and another with account balances and I want to look at the average and STDev of the balances if the customer is based in the UK (for example)

    Is there an easy way of doing this?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    10-17-2007
    Location
    Washington, DC
    Posts
    103
    is the list (or can it be) sorted by the country? If so, you would be able to use an offset and match formula to define the range you want in the average or stdev function.

    =average(offset(b1,match("UK",A:A,0),0,1,1))

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    Hi,

    or you could use array functions...

    with countrys in A and values in B

    {=STDEV(IF(A1:A100="UK",B1:B100,""))} and

    {=AVERAGE(IF(A1:A100="UK",B1:B100,""))}
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Registered User
    Join Date
    11-20-2007
    Posts
    2
    I couldn't get either of the above to work, so I actually pivoted the data and did a vlookup of the STDev and Means - thankfully pivot tables allow you to STDev in the metrics!

    Thanks for your help guys.

+ 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