Thread
:
SUMIF
View Single Post
#
5
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
Posts: 10,124
SUMIF
When posting you should always present the full question. Try this macro for
row 1
Sub sumproducttextwithvalue()
Dim ms As Long
dim i as long
dim ms as double
On Error Resume Next
For i = 1 To Cells(1, Columns.Count).End(xlToLeft).Column
If LCase(Left(Cells(1, i), 3)) = "ill" Then
ms = ms + Mid(Cells(1, i), 4, 5)
End If
Next i
MsgBox Format(ms, "00.00")
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Sam G" wrote in message
...
"Don Guillett" wrote:
=sumproduct((a2:f2="ill")*(a2:f2<=8)*a2:f2)
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Sam G" <Sam
wrote in message
...
I am trying to create a formula to sum across a row with the following:
If any of the cells contain the text "ILL" and the number value is
equal
to
8 or less than 8 sum. Any ideas?
Thanks Don.. David is correct it returned a #value error. Let me try
again. What I am trying to accomplishis, let's say I have 31 cells on
the same row that contain the following; I'll just use 3 cells for the
example. cell A1="ILL 8" cell B1= "ILL 6.2" and cell C1 has "ILL 8". If
these were totaled there would be 22.2 "ILL". That's what I am trying to
do account for ill hours thoughout any given month.
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett