Thread
:
SUMIF function
View Single Post
#
6
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
Posts: 10,124
SUMIF function
Or a function entered =snt(a1:b17,"v")
Function snt(rng, ltr)
snt = 0
For Each c In rng
If InStr(c, ltr) Then
snt = snt + Replace(c, ltr, "")
End If
Next
End Function
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Don Guillett" wrote in message
...
This will sum any cell in the range that has a "v" anywhere, before or
after the number. For v at the end, try
if right(c,1)="v" then
'=========
Option Compare Text
Sub sumnumbersintext()
ms = 0
For Each c In Range("a1:b21")
If InStr(c, "v") Then
ms = ms + Replace(c, "v", "")
End If
Next
MsgBox ms
End Sub
'========
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Kathryn" wrote in message
...
I want to use sumif on a row cells containing something like 2V, 4V, 1V,
3S,
8S, etc. I want to add the cells that have V in them.
I have tried using =SUMIF(A17:W17,"V",A17:W17) but it doesn't seem to
work.
I'm wondering if the sum range is bothered by the letters in the cells (V
or
S).
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett