+ Reply to Thread
Results 1 to 5 of 5

Assign underlying numeric values to text for the purpose of calculating an average.

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Assign underlying numeric values to text for the purpose of calculating an average.

    Hello,

    What is the best way to accomplish this?


    I have cells with text (High, Medium, Low) in them. I want the text to diplay in the cell but I want to assign an underlying numeric value so I can calculate an average.


    I would like High to always be worth 5, Medium always worth 3 and Low always worth 1.

    Ex:

    A1 = HIGH B1 = MEDIUM C1 = LOW

    I would like D1 to display the average of the underlying numerical values so D1 would display 3. (5+3+1)/3

    Ex2:

    A1 = HIGH B1= HIGH C1 = Medium
    D1 would display 4.3. (5+5+3)/3


    I'm not sure what type of formula to use in D1

    Thanks

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Assign underlying numeric values to text for the purpose of calculating an average.

    Try this:
    =AVERAGE(LOOKUP(A1:C1,{"HIGH","LOW","MEDIUM"},{5,1,3}))
    Confirmed by Holding both Ctrl-shift then Enter
    Quang PT

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Assign underlying numeric values to text for the purpose of calculating an average.

    =LOOKUP(LEFT(A1,1),{"H","L","M"},{5,1,3})

    or

    =MID("135",FIND(LEFT(A1,1),"LMH"),1)

    will return an average

    Replace A1 with B1 and C1 and just add them together and divide by 3
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: Assign underlying numeric values to text for the purpose of calculating an average.

    Please find the attached, this might also help you to calculate your requirement.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Assign underlying numeric values to text for the purpose of calculating an average.

    Many thanks. For future reference - what is the best term to describe the use of the curly braces if I were to search for that again?

+ 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