Checking for words and multiplying by a cell

Takron

New Member
Joined
May 12, 2011
Messages
12
I am checking for words in a column using this function: =COUNTIF(C7:C33,"*Colorless*") or =COUNTIF(C7:C33,"*Blue*")

When the word is detected within the range I have them output to a cell that labels what the word was and the amount so if it was 'Blue' then the label would be [Blue][6] if it detected 6 instances of Blue within the range. What I want to do is, when the word is detected, I want the word it detects to get multiplied by the number of the cell next to it. So if it detects blue and there is a 2 in the cell to the left, I want the countif to count it as two instances of blue, not just one and then add it to the total.
[2][Blue]
[2][Green]
[4][Colorless]
[1][Blue]
[4][Blue]
[3][Red]
If those were cells I would want the output to be [Blue][7] not [Blue][3]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I am checking for words in a column using this function: =COUNTIF(C7:C33,"*Colorless*") or =COUNTIF(C7:C33,"*Blue*")

When the word is detected within the range I have them output to a cell that labels what the word was and the amount so if it was 'Blue' then the label would be [Blue][6] if it detected 6 instances of Blue within the range. What I want to do is, when the word is detected, I want the word it detects to get multiplied by the number of the cell next to it. So if it detects blue and there is a 2 in the cell to the left, I want the countif to count it as two instances of blue, not just one and then add it to the total.
[2][Blue]
[2][Green]
[4][Colorless]
[1][Blue]
[4][Blue]
[3][Red]
If those were cells I would want the output to be [Blue][7] not [Blue][3]

Try...

=SUMIF($B$2:$B$7,"Blue",$A$2:$A$7)

where color items are in B2:B7 and numbers in A2:A7.
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top