#1   Report Post  
Pablo
 
Posts: n/a
Default sum "like"?

Is there a function or array that can sum anything like "001-"?

For example, I have a list of #s such as:

001-001
001-004
002-001
001-005
004-001

in a column, and the next column list values such as:

$5
$7
$9
$10
$3

How can I sum everything that is like "001-"? So sum 001-001, 001-004, and
001-005?

Thanks!


  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

=SUMIF(A:A,"001-*",B:B)

HTH
Jason
Atlanta, GA

-----Original Message-----
Is there a function or array that can sum anything

like "001-"?

For example, I have a list of #s such as:

001-001
001-004
002-001
001-005
004-001

in a column, and the next column list values such as:

$5
$7
$9
$10
$3

How can I sum everything that is like "001-"? So sum 001-

001, 001-004, and
001-005?

Thanks!


.

  #3   Report Post  
Mel Arquiza
 
Posts: n/a
Default

Hi Pablo,

This is not a straight forward thing.
But I hope this helps. Do you now Visual Basic program.

Sub Sample()
Dim XXX As String
Do Until IsEmpty(Range("A" & curRow + 1).Value)
curRow = curRow + 1
Range("A" & curRow).Select
For Each CurCell In Selection
If Left(CurCell.Value, 3) = "001" Then
MsgBox "OK"
Else
MsgBox "Not OK"
End If
Next
Loop
End Sub

If you put all the numbers 001-001 etc. in A column then run the macro above.
It will prompt you with Ok and Not Ok all you need to do is figure it out
what cell
you gonna put on the Ok and Not Ok corresponding to the number to be added.

Hope it helps a bit.

"Pablo" wrote:

Is there a function or array that can sum anything like "001-"?

For example, I have a list of #s such as:

001-001
001-004
002-001
001-005
004-001

in a column, and the next column list values such as:

$5
$7
$9
$10
$3

How can I sum everything that is like "001-"? So sum 001-001, 001-004, and
001-005?

Thanks!



  #4   Report Post  
Pablo
 
Posts: n/a
Default

worked great! Thanks!


"Jason Morin" wrote in message
...
=SUMIF(A:A,"001-*",B:B)

HTH
Jason
Atlanta, GA

-----Original Message-----
Is there a function or array that can sum anything

like "001-"?

For example, I have a list of #s such as:

001-001
001-004
002-001
001-005
004-001

in a column, and the next column list values such as:

$5
$7
$9
$10
$3

How can I sum everything that is like "001-"? So sum 001-

001, 001-004, and
001-005?

Thanks!


.



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



All times are GMT +1. The time now is 02:51 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"