+ Reply to Thread
Results 1 to 6 of 6

If/Then calculate the average

  1. #1
    LynnJ
    Guest

    If/Then calculate the average

    I'm trying to find a formula that will calculate the average number of days
    it takes for a certain type of material to move through my department. Where
    column A is the type of material on a book truck and column I is the number
    of days it took for that book truck to move through the department.

    If the cells in column A= MUSIC then average the cells of the same row in
    column I.

    I've been playing with the SUMIF and AVERAGE functions but haven't been able
    to figure it out.

    It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.

    Any help is greatly appreciated.




  2. #2
    Roger Govier
    Guest

    Re: If/Then calculate the average

    Hi Lynn

    I can't see whay that array formula wouldn't work, unless there is
    something wrong with the data.

    You could try
    =SUMPRODUCT(--(A2:A399="MUSIC"),--(I2:I339))/COUNTIF(A2:A339,"MUSIC")


    --
    Regards

    Roger Govier

    LynnJ <LynnJ@discussions.microsoft.com> wrote
    > I'm trying to find a formula that will calculate the average number
    > of days it takes for a certain type of material to move through my
    > department. Where column A is the type of material on a book truck
    > and column I is the number of days it took for that book truck to
    > move through the department. If the cells in column A= MUSIC then
    > average the cells of the same row in column I.
    > I've been playing with the SUMIF and AVERAGE functions but haven't
    > been able to figure it out.
    > It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array
    > formula. Any help is greatly appreciated.







  3. #3
    Ron Coderre
    Guest

    RE: If/Then calculate the average

    Try this:
    =AVERAGE(IF(A2:A399="MUSIC",I2:I399))
    Note: commit that array formula by holding down [Ctrl]+[Shift] and press
    [Enter]


    Does that help?

    ***********
    Regards,
    Ron

    XL2002, WinXP-Pro


    "LynnJ" wrote:

    > I'm trying to find a formula that will calculate the average number of days
    > it takes for a certain type of material to move through my department. Where
    > column A is the type of material on a book truck and column I is the number
    > of days it took for that book truck to move through the department.
    >
    > If the cells in column A= MUSIC then average the cells of the same row in
    > column I.
    >
    > I've been playing with the SUMIF and AVERAGE functions but haven't been able
    > to figure it out.
    >
    > It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.
    >
    > Any help is greatly appreciated.
    >
    >
    >


  4. #4
    bj
    Guest

    RE: If/Then calculate the average

    have you tried
    =sumif(A2:A399,"MUSIC",I2:I399)/countif(A2:A399,"MUSIC")

    "LynnJ" wrote:

    > I'm trying to find a formula that will calculate the average number of days
    > it takes for a certain type of material to move through my department. Where
    > column A is the type of material on a book truck and column I is the number
    > of days it took for that book truck to move through the department.
    >
    > If the cells in column A= MUSIC then average the cells of the same row in
    > column I.
    >
    > I've been playing with the SUMIF and AVERAGE functions but haven't been able
    > to figure it out.
    >
    > It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.
    >
    > Any help is greatly appreciated.
    >
    >
    >


  5. #5
    Duke Carey
    Guest

    RE: If/Then calculate the average

    Just a slight issue with your formula:

    =AVERAGE(IF(A2:A399="MUSIC",I2:I399,""))

    Enter it as an array formula


    "LynnJ" wrote:

    > I'm trying to find a formula that will calculate the average number of days
    > it takes for a certain type of material to move through my department. Where
    > column A is the type of material on a book truck and column I is the number
    > of days it took for that book truck to move through the department.
    >
    > If the cells in column A= MUSIC then average the cells of the same row in
    > column I.
    >
    > I've been playing with the SUMIF and AVERAGE functions but haven't been able
    > to figure it out.
    >
    > It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.
    >
    > Any help is greatly appreciated.
    >
    >
    >


  6. #6
    Roger Govier
    Guest

    Re: If/Then calculate the average

    Luckily, others were wider awake than I was, and spotted the "," in
    place of the "=" in your array formula.

    --
    Regards

    Roger Govier


    Roger Govier <roger@technologyNOSPAM4u.co.uk> wrote
    > Hi Lynn
    > I can't see whay that array formula wouldn't work, unless there is
    > something wrong with the data.
    > You could try
    > =SUMPRODUCT(--(A2:A399="MUSIC"),--(I2:I339))/COUNTIF(A2:A339,"MUSIC")







+ 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