How to Assign Value to Text and Sum in Excel (2 Easy Methods)

We have some movies and the remarks of some critics. We have assigned some values to these remarks. With these values, we will calculate the total score of each movie.

excel assign value to text and sum


Method 1 – Merge SUM and COUNTIF Functions to Assign a Value to Text and Sum

Steps:

  • Go to F5 and enter the following formula
=SUM(COUNTIF(C5:E5,$H$5:$H$7)*$I$5:$I$7)

For each cell in C5:E5, the formula counts the instances of text in the lookup range, then multiplies that with the respective result.

excel assign value to text and sum

  • Press Enter. Excel will return the output.

excel assign value to text and sum

Note: This is an array formula. If you are using earlier versions of Excel, you must press Ctrl + Shift + Enter instead of Enter only.
  • Use the Fill Handle to AutoFill to F13.

Read More: How to Sum Text Values Like Numbers in Excel 


Method 2 – Combine SUM, INDEX, MATCH, N, and IF Functions to Assign Value to Text and Sum

Steps:

  • Go to F5 and insert the following formula:
=SUM(INDEX($I$5:$I$7,N(IF(1,MATCH(C5:E5,$H$5:$H$7,0)))))

excel assign value to text and sum

Formula Breakdown:

  • MATCH(C5:E5,$H$5:$H$7,0)
    • Output: {1,2,1}
  • IF(1,MATCH(C5:E5,$H$5:$H$7,0))
    • Output: {1,2,1}
  • N(IF(1,MATCH(C5:E5,$H$5:$H$7,0)))
    • Output: {1,2,1}
  • INDEX($I$5:$I$7,N(IF(1,MATCH(C5:E5,$H$5:$H$7,0))))
    • Output: {5,3,5}
  • SUM(INDEX($I$5:$I$7,N(IF(1,MATCH(C5:E5,$H$5:$H$7,0)))))
  • SUM(5,3,5)
    • Output: 13
  • Hit Enter.

  • Use the Fill Handle to AutoFill to F13.

excel assign value to text and sum

Read More: How to Sum Only Numbers and Ignore Text in Same Cell in Excel


Download the Practice Workbook


Related Articles


<< Go Back to Excel Sum If Cell Contains Text | Excel SUMIF Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Akib Bin Rashid
Akib Bin Rashid

AKIB BIN RASHID, a materials and metallurgical engineer, is passionate about delving into Excel and VBA programming. To him, programming is a valuable time-saving tool for managing data, files, and internet-related tasks. Proficient in MS Office, AutoCAD, Excel, and VBA, he goes beyond the fundamentals. Holding a B.Sc in Materials and Metallurgical Engineering from Bangladesh University of Engineering and Technology, MD AKIB has transitioned into a content development role. Specializing in creating technical content centred around Excel and... Read Full Bio

2 Comments
  1. Very useful
    Good job and God bless you

  2. Hi G0DWIN,
    Thank you for your kind words!

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo