+ Reply to Thread
Results 1 to 6 of 6

What is wrong with this =AVERAGE(IF formula?

  1. #1
    Registered User
    Join Date
    04-08-2004
    Posts
    39

    What is wrong with this =AVERAGE(IF formula?

    Hi everybody,

    I have an =AVERAGE(IF… statement in one worksheet that refers to raw data in another worksheet. Here is what the raw data looks like:

    Column I Column U Column Y
    02-01-001....1.0....5
    02-01-001....1.1....4
    02-01-001....1.1....2
    02-01-001....1.2....5
    02-01-001....1.2....1
    02-01-001....2.0....3
    02-01-001....2.1....5
    02-01-001....2.1....4
    02-01-001....2.2....2
    02-01-001....2.2....2
    02-02-002....1.0....5
    02-02-002....1.1....3
    02-02-002....1.1....1
    02-02-002....1.2....5
    02-02-002....1.2....2

    In another worksheet, I have this formula:

    {=AVERAGE(IF(AND(raw!$I$2:raw!$I$1000="02-01-001",raw!$U$2:raw!$U$1000=1.1),raw!$Y$2:raw!$Y$1000))}

    I want this formula to find values in Y for records that have a value of 02-01-001 in I and a value of 1.1 in U. Looking at the table above, the resulting value should be (4+2)/2=3. However, all I get is 0.0 as a result. What is wrong with the formula? And I am pressing CTRL+SFT+Enter when I get out of the formula.

    I would also like to know how I can change the formula so that I can reference an entire column rather than having to reference 2:1000. The data will eventually extend past 1000. Thanks.

    Thank you very much for your help.
    Last edited by fbarbie; 03-16-2005 at 09:27 AM.

  2. #2
    Bernard Liengme
    Guest

    Re: What is wrong with this =AVERAGE(IF formula?

    You cannot use Boolean function in an array formula
    Try:
    SUMPRODUCT(--(raw!$I$2:raw!$I$1000="02-01-001"),--(raw!$U$2:raw!$U$1000=1.1),raw!$Y$2:raw!$Y$1000)/SUMPRODUCT(--(raw!$I$2:raw!$I$1000="02-01-001"),--(raw!$U$2:raw!$U$1000=1.1))best wishes--Bernard V Liengmewww.stfx.ca/people/bliengmeremove caps from email"fbarbie" <[email protected]> wrote in messagenews:[email protected]...>> Hi everybody,>> I have an =AVERAGE(IF. statement in one worksheet that refers to raw> data in another worksheet. Here is what the raw data looks like:>> Column I Column U Column Y> 02-01-001 1.0 5> 02-01-001 1.1 4> 02-01-001 1.1 2> 02-01-001 1.2 5> 02-01-001 1.2 1> 02-01-001 2.0 3> 02-01-001 2.1 5> 02-01-001 2.1 4> 02-01-001 2.2 2> 02-01-001 2.2 2> 02-02-002 1.0 5> 02-02-002 1.1 3> 02-02-002 1.1 1> 02-02-002 1.2 5> 02-02-002 1.2 2>> In another worksheet, I have this formula:>>{=AVERAGE(IF(AND(raw!$I$2:raw!$I$1000="02-01-001",raw!$U$2:raw!$U$1000=1.1),raw!$Y$2:raw!$Y$1000))}>> I want this formula to find values in Y for records that have a value> of 02-01-001 in I and a value of 1.1 in U. Looking at the table above,> the resulting value should be (4+2)/2=3. However, all I get is 0.0 as a> result. What is wrong with the formula? And I am pressing> CTRL+SFT+Enter when I get out of the formula.>> I would also like to know how I can change the formula so that I can> reference an entire column rather than having to reference 2:1000. The> data will eventually extend past 1000. Thanks.>> Thank you very much for your help.>>> --> fbarbie> ------------------------------------------------------------------------> fbarbie's Profile:http://www.excelforum.com/member.php?action=getinfo&userid=8110> View this thread: http://www.excelforum.com/showthread.php?threadid=354764>


  3. #3
    Jason Morin
    Guest

    Re: What is wrong with this =AVERAGE(IF formula?

    I didn't test this, but it should work:

    =AVERAGE(IF((raw!$I$2:$I$1000="02-01-001")*(raw!$U$2:raw!
    $U$1000=1.1),raw!$Y$2:$Y$1000))

    Array-entered.

    HTH
    Jason
    Atlanta, GA

    >-----Original Message-----
    >
    >Hi everybody,
    >
    >I have an =AVERAGE(IF. statement in one worksheet that

    refers to raw
    >data in another worksheet. Here is what the raw data

    looks like:
    >
    >Column I Column U Column Y
    >02-01-001 1.0 5
    >02-01-001 1.1 4
    >02-01-001 1.1 2
    >02-01-001 1.2 5
    >02-01-001 1.2 1
    >02-01-001 2.0 3
    >02-01-001 2.1 5
    >02-01-001 2.1 4
    >02-01-001 2.2 2
    >02-01-001 2.2 2
    >02-02-002 1.0 5
    >02-02-002 1.1 3
    >02-02-002 1.1 1
    >02-02-002 1.2 5
    >02-02-002 1.2 2
    >
    >In another worksheet, I have this formula:
    >
    >{=AVERAGE(IF(AND(raw!$I$2:raw!$I$1000="02-01-001",raw!

    $U$2:raw!$U$1000=1.1),raw!$Y$2:raw!$Y$1000))}
    >
    >I want this formula to find values in Y for records that

    have a value
    >of 02-01-001 in I and a value of 1.1 in U. Looking at

    the table above,
    >the resulting value should be (4+2)/2=3. However, all I

    get is 0.0 as a
    >result. What is wrong with the formula? And I am

    pressing
    >CTRL+SFT+Enter when I get out of the formula.
    >
    >I would also like to know how I can change the formula

    so that I can
    >reference an entire column rather than having to

    reference 2:1000. The
    >data will eventually extend past 1000. Thanks.
    >
    >Thank you very much for your help.
    >
    >
    >--
    >fbarbie
    >---------------------------------------------------------

    ---------------
    >fbarbie's Profile: http://www.excelforum.com/member.php

    action=getinfo&userid=8110
    >View this thread:

    http://www.excelforum.com/showthread...hreadid=354764
    >
    >.
    >


  4. #4
    Bob Phillips
    Guest

    Re: What is wrong with this =AVERAGE(IF formula?

    Your syntax has a lot of problems, bu here's an alternative

    =SUMPRODUCT(--(raw!$I$2:raw!$I$2:$I$10=--"2005-01-02"),--(raw!$I$2:raw!$U$2:
    $U$10=1),raw!$I$2:raw!$Y$2:$Y$10)/SUMPRODUCT(--(raw!$I$2:raw!$I$2:$I$10=--"2
    005-01-02"),--(raw!$I$2:raw!$U$2:$U$10=1))

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "fbarbie" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi everybody,
    >
    > I have an =AVERAGE(IF. statement in one worksheet that refers to raw
    > data in another worksheet. Here is what the raw data looks like:
    >
    > Column I Column U Column Y
    > 02-01-001 1.0 5
    > 02-01-001 1.1 4
    > 02-01-001 1.1 2
    > 02-01-001 1.2 5
    > 02-01-001 1.2 1
    > 02-01-001 2.0 3
    > 02-01-001 2.1 5
    > 02-01-001 2.1 4
    > 02-01-001 2.2 2
    > 02-01-001 2.2 2
    > 02-02-002 1.0 5
    > 02-02-002 1.1 3
    > 02-02-002 1.1 1
    > 02-02-002 1.2 5
    > 02-02-002 1.2 2
    >
    > In another worksheet, I have this formula:
    >
    >

    {=AVERAGE(IF(AND(raw!$I$2:raw!$I$1000="02-01-001",raw!$U$2:raw!$U$1000=1.1),
    raw!$Y$2:raw!$Y$1000))}
    >
    > I want this formula to find values in Y for records that have a value
    > of 02-01-001 in I and a value of 1.1 in U. Looking at the table above,
    > the resulting value should be (4+2)/2=3. However, all I get is 0.0 as a
    > result. What is wrong with the formula? And I am pressing
    > CTRL+SFT+Enter when I get out of the formula.
    >
    > I would also like to know how I can change the formula so that I can
    > reference an entire column rather than having to reference 2:1000. The
    > data will eventually extend past 1000. Thanks.
    >
    > Thank you very much for your help.
    >
    >
    > --
    > fbarbie
    > ------------------------------------------------------------------------
    > fbarbie's Profile:

    http://www.excelforum.com/member.php...fo&userid=8110
    > View this thread: http://www.excelforum.com/showthread...hreadid=354764
    >




  5. #5
    Bob Phillips
    Guest

    Re: What is wrong with this =AVERAGE(IF formula?

    =AVERAGE(IF((raw!$I$2:$I$1000=--"2005-01-02")*(raw!$U$2:$U$1000=1.1),raw!$Y$
    2:$Y$1000))

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jason Morin" <[email protected]> wrote in message
    news:[email protected]...
    > I didn't test this, but it should work:
    >
    > =AVERAGE(IF((raw!$I$2:$I$1000="02-01-001")*(raw!$U$2:raw!
    > $U$1000=1.1),raw!$Y$2:$Y$1000))
    >
    > Array-entered.
    >
    > HTH
    > Jason
    > Atlanta, GA
    >
    > >-----Original Message-----
    > >
    > >Hi everybody,
    > >
    > >I have an =AVERAGE(IF. statement in one worksheet that

    > refers to raw
    > >data in another worksheet. Here is what the raw data

    > looks like:
    > >
    > >Column I Column U Column Y
    > >02-01-001 1.0 5
    > >02-01-001 1.1 4
    > >02-01-001 1.1 2
    > >02-01-001 1.2 5
    > >02-01-001 1.2 1
    > >02-01-001 2.0 3
    > >02-01-001 2.1 5
    > >02-01-001 2.1 4
    > >02-01-001 2.2 2
    > >02-01-001 2.2 2
    > >02-02-002 1.0 5
    > >02-02-002 1.1 3
    > >02-02-002 1.1 1
    > >02-02-002 1.2 5
    > >02-02-002 1.2 2
    > >
    > >In another worksheet, I have this formula:
    > >
    > >{=AVERAGE(IF(AND(raw!$I$2:raw!$I$1000="02-01-001",raw!

    > $U$2:raw!$U$1000=1.1),raw!$Y$2:raw!$Y$1000))}
    > >
    > >I want this formula to find values in Y for records that

    > have a value
    > >of 02-01-001 in I and a value of 1.1 in U. Looking at

    > the table above,
    > >the resulting value should be (4+2)/2=3. However, all I

    > get is 0.0 as a
    > >result. What is wrong with the formula? And I am

    > pressing
    > >CTRL+SFT+Enter when I get out of the formula.
    > >
    > >I would also like to know how I can change the formula

    > so that I can
    > >reference an entire column rather than having to

    > reference 2:1000. The
    > >data will eventually extend past 1000. Thanks.
    > >
    > >Thank you very much for your help.
    > >
    > >
    > >--
    > >fbarbie
    > >---------------------------------------------------------

    > ---------------
    > >fbarbie's Profile: http://www.excelforum.com/member.php?

    > action=getinfo&userid=8110
    > >View this thread:

    > http://www.excelforum.com/showthread...hreadid=354764
    > >
    > >.
    > >




  6. #6
    Jason Morin
    Guest

    Re: What is wrong with this =AVERAGE(IF formula?

    I assumed column I aren't dates.

    Jason

    >-----Original Message-----
    >=AVERAGE(IF((raw!$I$2:$I$1000=--"2005-01-02")*(raw!

    $U$2:$U$1000=1.1),raw!$Y$
    >2:$Y$1000))
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"Jason Morin" <[email protected]> wrote

    in message
    >news:[email protected]...
    >> I didn't test this, but it should work:
    >>
    >> =AVERAGE(IF((raw!$I$2:$I$1000="02-01-001")*(raw!

    $U$2:raw!
    >> $U$1000=1.1),raw!$Y$2:$Y$1000))
    >>
    >> Array-entered.
    >>
    >> HTH
    >> Jason
    >> Atlanta, GA
    >>
    >> >-----Original Message-----
    >> >
    >> >Hi everybody,
    >> >
    >> >I have an =AVERAGE(IF. statement in one worksheet that

    >> refers to raw
    >> >data in another worksheet. Here is what the raw data

    >> looks like:
    >> >
    >> >Column I Column U Column Y
    >> >02-01-001 1.0 5
    >> >02-01-001 1.1 4
    >> >02-01-001 1.1 2
    >> >02-01-001 1.2 5
    >> >02-01-001 1.2 1
    >> >02-01-001 2.0 3
    >> >02-01-001 2.1 5
    >> >02-01-001 2.1 4
    >> >02-01-001 2.2 2
    >> >02-01-001 2.2 2
    >> >02-02-002 1.0 5
    >> >02-02-002 1.1 3
    >> >02-02-002 1.1 1
    >> >02-02-002 1.2 5
    >> >02-02-002 1.2 2
    >> >
    >> >In another worksheet, I have this formula:
    >> >
    >> >{=AVERAGE(IF(AND(raw!$I$2:raw!$I$1000="02-01-001",raw!

    >> $U$2:raw!$U$1000=1.1),raw!$Y$2:raw!$Y$1000))}
    >> >
    >> >I want this formula to find values in Y for records

    that
    >> have a value
    >> >of 02-01-001 in I and a value of 1.1 in U. Looking at

    >> the table above,
    >> >the resulting value should be (4+2)/2=3. However, all

    I
    >> get is 0.0 as a
    >> >result. What is wrong with the formula? And I am

    >> pressing
    >> >CTRL+SFT+Enter when I get out of the formula.
    >> >
    >> >I would also like to know how I can change the formula

    >> so that I can
    >> >reference an entire column rather than having to

    >> reference 2:1000. The
    >> >data will eventually extend past 1000. Thanks.
    >> >
    >> >Thank you very much for your help.
    >> >
    >> >
    >> >--
    >> >fbarbie
    >> >------------------------------------------------------

    ---
    >> ---------------
    >> >fbarbie's Profile:

    http://www.excelforum.com/member.php?
    >> action=getinfo&userid=8110
    >> >View this thread:

    >> http://www.excelforum.com/showthread.php

    threadid=354764
    >> >
    >> >.
    >> >

    >
    >
    >.
    >


+ 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