+ Reply to Thread
Results 1 to 5 of 5

Using average if with alphanumeric cells

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Using average if with alphanumeric cells

    Hi all,

    I’ve been searching this forum as well as others for some time trying to figure out how to use the average if function with a set of data that contains alphanumeric cells. I’m having no luck and was wondering if someone would be so kind to help me. My worksheet has two columns; one with quantities the other with prices in alphanumeric form. E.g.

    QTY PRICE
    12 GBP 12.00
    14 GBP 18.00
    2 GBP 2.00
    4 GBP 4.00
    10 GBP 10.00

    What I need is a formula which would average the numeric elements of the price data above a specified quantity. E.g. the average price for quantities above say 5 is (12+18+10)/3 = 10.

    Below is what I’ve come up with so far and is an array formula (ctrl+shift+enter) which averages all the prices.

    =AVERAGE(IF(ISERROR(FIND(" ",B2:B6)),"",RIGHT(B2:B5002,LEN(B2:B6)-FIND(" ",B2:B6))*1))

    I hope this all makes sense. Please let me know if otherwise.

    Any help will be greatly appreciated.

    Many thanks
    Last edited by benjison; 08-29-2012 at 05:11 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using average if with alphanumeric cells

    Try:

    =AVERAGE(IF(A2:A6>5,MID(B2:B6,FIND(" ",B2:B6),10)+0))

    confirmed with CTRL+SHIFT+ENTER not just ENTER

    the average of those should be 13.3333333 not 10
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-11-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Using average if with alphanumeric cells

    Thanks for the quick response. I've just tried your formula and it works! Got one problem though. If I have an empty cell in the price column #VALUE! is displayed. Is there a way to get around this?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using average if with alphanumeric cells

    Try:

    =AVERAGE(IF(A2:A6>5,IF(B2:B6<>"",MID(B2:B6,FIND(" ",B2:B6),10)+0)))

  5. #5
    Registered User
    Join Date
    04-11-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Using average if with alphanumeric cells

    That's the one! Thank you so much!

+ 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