+ Reply to Thread
Results 1 to 4 of 4

multiple averages

  1. #1
    Registered User
    Join Date
    03-06-2005
    Posts
    8

    multiple averages

    I need a formula that will calculate the average price for a particular part number.

    There are 500 different parts number in column A, each price is different and is in column b

    can I do a sumproduct average combo???!!. this one has me totally baffled

    many thnaks
    andy

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try the following...

    =SUMIF(A1:A100,PartNumber,B1:B100)/COUNTIF(A1:A100,PartNumber)

    or

    =AVERAGE(IF(A1:A100=PartNumber,B1:B100))

    ...confirmed with CONTROL+****+ENTER.

    If you'd like to avoid an error value when no data or part number exists...

    =SUMIF(A1:A100,PartNumber,B1:B100)/MAX(1,COUNTIF(A1:A100,PartNumber))

    =IF(COUNTIF(A1:A100,PartNumber),AVERAGE(IF(A1:A100=PartNumber,B1:B100)),"")

    ...confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

  3. #3
    Registered User
    Join Date
    03-06-2005
    Posts
    8

    more help required

    I used

    =SUMPRODUCT(--('Margin Report'!$A$2:$A$6000=$A9),'Margin Report'!$B$2:$B$6000)/SUMPRODUCT(--('Margin Report'!$A$2:$A$6000=$A9))

    this worked to figure out the average so on ect but I couldnt get it to return a blank if no part number exsisted. I tried ,"") at the end windows wouoldnt let me apply.

    can you help

    Andy

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Since you have only one condition, SUMIF would suffice. But if you insist...

    =SUMPRODUCT(--('Margin Report'!$A$2:$A$6000=$A9),'Margin Report'!$B$2:$B$6000)/MAX(1,SUMPRODUCT(--('Margin Report'!$A$2:$A$6000=$A9)))

    or

    =IF(COUNTIF($A$2:$A$6000,$A9),SUMPRODUCT(--('Margin Report'!$A$2:$A$6000=$A9),'Margin Report'!$B$2:$B$6000)/SUMPRODUCT(--('Margin Report'!$A$2:$A$6000=$A9)),"")

    Hope this helps!

+ 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