#1   Report Post  
Mehta Mehta
 
Posts: n/a
Default SUMIF

Hi,

I want to put a sumif formula, but only recognising one character in a
string of text.

For example:

£
CLX75 - 10
CLX69 - 20
CLS65 - 5
CLT12 - 65
CLX59 - 151
CLT60 - 15

I want to return the total via a sumif on those that contained the letter X
(3 rd character of the text). So the answer would 181.

Can you please help.

Thanks

--
hm
  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

=SUMPRODUCT(--(MID(A1:A6,3,1)="X"),(B1:B6))


"Mehta Mehta" wrote in message
...
Hi,

I want to put a sumif formula, but only recognising one character in a
string of text.

For example:

£
CLX75 - 10
CLX69 - 20
CLS65 - 5
CLT12 - 65
CLX59 - 151
CLT60 - 15

I want to return the total via a sumif on those that contained the letter
X
(3 rd character of the text). So the answer would 181.

Can you please help.

Thanks

--
hm



  #3   Report Post  
bigwheel
 
Posts: n/a
Default

"Mehta Mehta" wrote:

Hi,

I want to put a sumif formula, but only recognising one character in a
string of text.

For example:

£
CLX75 - 10
CLX69 - 20
CLS65 - 5
CLT12 - 65
CLX59 - 151
CLT60 - 15

I want to return the total via a sumif on those that contained the letter X
(3 rd character of the text). So the answer would 181.

Can you please help.

Thanks

--
hm


Using your example data in cell A1 with this macro the result is 181:-

Sub cond_sum()
total = 0
For a = 1 To 6
If Mid(Cells(a, 1), 3, 1) = "X" Then
total = total + Cells(a, 2)
End If
Next a
Cells(8, 2) = total
End Sub

If it helps ...
  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

N Harkawat wrote...
=SUMPRODUCT(--(MID(A1:A6,3,1)="X"),(B1:B6))

....

=SUMIF(A1:A6,"??X*",B1:B6)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use SUMIF to return sums between two values located in cells ScottBerger Excel Worksheet Functions 2 April 23rd 23 09:05 PM
How do I use the sumif if I have multiple criteria (i.e. greater . Kellyatisl Excel Worksheet Functions 3 June 4th 06 06:33 AM
Dynamic sumif function Jimbola Excel Worksheet Functions 5 May 4th 05 01:10 AM
SUMIF Not vanjohnson Excel Discussion (Misc queries) 1 March 4th 05 08:42 PM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM


All times are GMT +1. The time now is 09:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"