Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to average values if another column contains certain text in Excel?

If you have a range of data which column A is the product name and column B contains the total price, and now, you would like to average the values in column B if column A contains a certain text to get the following result. How could you deal with this task in Excel quickly and easily?

Average values if another column contains certain text with formulas

Average values if another column contains certain text with Kutools for Excel

doc averageif contains text 1


Average / Sum / Count values if another column contains certain text:

Kutools for Excel's Advanced Combine Rows feature can help you to combine or sum, average, count cells based same values in another column as you need.

  • 1. Specify the key column that you want to combine other column based on;
  • 2. Choose one calculation for your combined data.

doc averageif contains text 9

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Average values if another column contains certain text with formulas


To calculate the average based on another column data, the following formulas may do you a favor, please do as follows:

1. First, you should extract the unique values from column A, please apply this array formula: =IFERROR(INDEX($A$2:$A$17, MATCH(0,COUNTIF($E$1:E1, $A$2:$A$17), 0)),"") into a blank cell, E2 for example, then press Ctrl + Shift + Enter keys together to get to correct result, see screenshot:

doc averageif contains text 2

Note: In the above formula, A2:A17 is the list that you want to extract unique values from, E1 is the first cell of the column you want to put out the extracting result.

2. Then drag the fill handle down to extract all unique values until blank cell is displayed, see screenshot:

doc averageif contains text 3

3. After extracting the unique values from column A, and now, you should use this formula: =AVERAGEIF($A$2:$A$17,E2,$B$2:$B$17) into cell F2 to calculate the average of the product “Apple”, then drag the fill handle down to the cells that you want to apply this formula, and the average of the values based on a specific text has been calculated at once, see screenshot:

doc averageif contains text 4

Note: In this formula: A2:A17 is the original data which contains the specific text you want to average based on, E2 is the unique value you have extracted, and B2:B17 is the total price column that you want to calculate the average.


Average values if another column contains certain text with Kutools for Excel

If you have Kutools for Excel, with its Advanced Combine Rows utility, you can quickly combine, sum, average the corresponding values from one column based on another column data.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days. 

After installing Kutools for Excel, please do as follows:( Free Download Kutools for Excel Now! )

1. Select the data range that you want to use.

2. Click Kutools > Content > Advanced Combine Rows, see screenshot:

doc averageif contains text 5

3. In the Advanced Combine Rows dialog box, click the column which contains the certain value you want to average based on, and then click Primary Key to set it as primary key, see screenshot:

doc averageif contains text 6

Tips: If your selection includes headers, please check My data has headers option.

4. Go on clicking another column that you want to calculate the average, and then click Calculate > Average, see screenshot:

doc averageif contains text 7

5. After finishing the settings, please click Ok button, and the average of the total price has been calculated based on the same data in column A, see screenshot:

doc averageif contains text 8

 Download and free trial Kutools for Excel Now !


Demo: Average values if another column contains certain text with Kutools for Excel

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.