+ Reply to Thread
Results 1 to 12 of 12

Average of A if column B is blank and C is populated unless containing specific text

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Average of A if column B is blank and C is populated unless containing specific text

    Hello all,

    I've had a look through the forum for the answer to this, but have not managed to locate it. If this has been asked in another post, please could you direct me to it.

    I have created an example to demonstrate what I am trying to achieve (in plain text below and attached as an XLSX).

    I am looking to work out the average of column A (Time) if the following criteria is matched:

    1. Column B (Fruit) is blank AND
    2. Column C (Colour) is populated, unless
    a) Column C contains Green OR
    b) Column C contains Yellow OR
    c) Column D contains Large.

    A B C D
    1 TIME FRUIT COLOUR SIZE
    2 6 APPLE GREEN LARGE
    3 4 MEDIUM
    4 9 ORANGE ORANGE SMALL
    5 18 ORANGE SMALL
    6 17 APPLE BLUE MEDIUM
    7 11 ORANGE MEDIUM
    8 23 GREEN SMALL
    9 6 ORANGE SMALL
    10 3 BLUE LARGE
    11 7 BANANA MEDIUM


    Using this example, only cells A5 and A9 meet the criteria specified, so the average should be 6.

    In future, the amount of rows may change and additional colours added, so I would like my formula to handle these.

    I am currently using Office 2007 but have access to any version.

    Any help you can offer would be appreciated hugely.

    Kind regards,
    Matt

    P.S. Sorry for the poor formatting of the plain text example - I will learn how to use the insert table function for next time!
    Attached Files Attached Files
    Last edited by mattr86; 01-14-2013 at 09:15 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi mattr86,

    But cell D5 is not "Large" , please check.

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi DILIPandey,

    You are correct - D5 is not Large and therefore should be counted. I need to count the average of A where column B is blank and C is populated, but it should not count A if C is Green or Yellow, or D is Large.

    Kind regards,
    Matt

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average of A if column B is blank and C is populated unless containing specific text

    but it should not count A if C is Green or Yellow, or D is Large.
    Okay.. in that case D10 is " Large " .. and you are considering that row.


    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi DILIPandey,

    D10 is Large, but should not be considered. Only cells rows 5 and 9 meet the specified criteria. In these two rows, column B is blank (criteria 1) and column C is populated but does not contain Green or Yellow or column D does not contain Large (Criteria 2). Sorry if I have not explained what I am trying to achieve clearly but thank you for trying to help me.

    Kind regards,
    Matt

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average of A if column B is blank and C is populated unless containing specific text

    I got the point why we are confused.. your serial numbers in column A looks like ROWs... because of this A5 looks like 5 but that is actually 4

    Would be great if you could put some different values there and then we can try cracking this.. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi DILIPandey,

    Lesson learned for next time - thank you!

    I've updated my original post and also attached 'Example2.xlsx' with updated values in Column A. A5 and A9 are still the only two values which meet the criteria (18 & 6), so the average should be 12.

    Thank you for your help.

    Kind regards,
    Matt

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi Matt,

    see the below file where I am getting 3 eligible values..

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Enter above formula using ctrl shift enter key combination

    Example2.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>

  9. #9
    Registered User
    Join Date
    12-12-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi DILIPandey,

    Thank you for this - I think we are nearly there. A3 should not be counted because C3 is not populated. I'm having a try now, but not sure what the best way of adding this into the existing formula would be...

    Kind regards,
    Matt

  10. #10
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Okay... got it now, use below one:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached:- Example2(1).xlsx


    Regards,
    DILIPandey
    <click on below * if this helps>

  11. #11
    Registered User
    Join Date
    12-12-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Average of A if column B is blank and C is populated unless containing specific text

    Hi DILIPandey,

    I have had a chance to test the formula with my real data and everything is working fine. Thank you very much for your help once again, it's hugely appreciated.

    Kind regards,
    Matt

  12. #12
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average of A if column B is blank and C is populated unless containing specific text

    you are welcome Matt...

    Cheers

    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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