+ Reply to Thread
Results 1 to 3 of 3

Harmonic Mean IF

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    North Dakota
    MS-Off Ver
    Excel 2010
    Posts
    8

    Harmonic Mean IF

    I am familiar with the AVERAGEIF and AVERAGEIFS functions, but am looking for a function that performs a HARMONIC mean on an array of data that share a particular parameter.

    For example: calculate the harmonic mean of B1 and B2 if A1=A2. Specifically, calcuate the harmonic mean of B1 to Bn if A1 to An share the same parameter.

    Does anyone know how to write such a function?

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Harmonic Mean IF

    Do you mean..

    =IF(A1=A2,HARMEAN(B1,B2))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Harmonic Mean IF

    Please Login or Register  to view this content.
    In D2, which assumes there are no zeros in col B,

    =COUNTIF(A1:A5, "Bob") / SUMPRODUCT(--(A1:A5="Bob"), 1/B1:B5)

    Or via an array formula,

    =HARMEAN(IF(A1:A5="Bob", B1:B5))
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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