Sum Up Cells That Contain The Letter "D" - Not SUMIF

fun2excel4money

New Member
Joined
Dec 24, 2016
Messages
18
Hello All,

I have a simple data set with two columns shown below. The first column contains an amount. The second column has a corresponding value that can either be "D", "R", "S", or any combination of the three letters. I am looking for a formula that can sum up the values where the second column contains a "D". I am trying to avoid CSE.


<style><!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";}@page {margin:1.0in .75in 1.0in .75in; mso-header-margin:.5in; mso-footer-margin:.5in;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}--></style>
1D
2D
3D
4D
5D
6D
7S
8S
9SD
10DSR
11R
12R
13DSR
14D
15S
16R
17S

<!--StartFragment--> <colgroup><col width="65" span="2" style="width:65pt"> </colgroup><tbody>
<!--EndFragment--></tbody>

Based on a regular sum, the total should be 67. I am currently using this formula: <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}</style>SUMPRODUCT((IFERROR(IF(SEARCH("d",B1:B17)>0,1,0),0)*A1:A17). This provides me a number of 153. If I use CSE, the amount populates to 67. I believe I have to use CSE because of the array in the search. If there is a similar solution without the use of CSE, I would love to know. Thank you very much in advance for your help!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Why does SUMIF not work (see below)?


Excel 2010
ABCD
11D67
22D
33D
44D
55D
66D
77S
88S
99SD
1010DSR
1111R
1212R
1313DSR
1414D
1515S
1616R
1717S
Sheet3
Cell Formulas
RangeFormula
D1=SUMIF(B1:B17,"*D*",A1:A17)
 
Last edited:
Upvote 0
Hi,

Modified SUMPRODUCT formula:


Book1
ABCD
11D67
22D
33D
44D
55D
66D
77S
88S
99SD
1010DSR
1111R
1212R
1313DSR
1414D
1515S
1616R
1717S
Sheet36
Cell Formulas
RangeFormula
D1=SUMPRODUCT((ISNUMBER(SEARCH("D",B1:B17))*A1:A17))
 
Upvote 0
They are wildcards meaning any character,
 
Upvote 0
You're welcome, thought you had some kind of reason for not using SUMIF since you had it in the thread Title. Mark's SUMIF is better than using SUMPRODUCT.
 
Upvote 0

Forum statistics

Threads
1,215,106
Messages
6,123,124
Members
449,097
Latest member
mlckr

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