LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default sumif or sumthing else?

Well, if it helps, this exactly what I have going on:

Data set:
Columns A & B;

Product Inventory Location <=Header
PrdA LocA
PrdA LocA
PrdB LocA
PrdC LocA
PrdB LocA
PrdA LocA
PrdB LocB
PrdB LocB
PrdC LocB
PrdC LocB

Columns E & F;

Prods Locs <=Header
PrdA LocA
PrdB LocA
PrdC LocA
PrdA LocB
PrdB LocB
PrdC LocB


Macro:

Sub sumprod_test()

Dim rng1 As Range, rng2 As Range, cell As Range
Dim cnt As Long
Set rng1 = Range("A2:A12")
Set rng2 = Range("B2:B12")
For Each cell In Range("E2:E7")
cnt = Application.Evaluate("Sumproduct(--(" & _
rng1.Address(0, 0, xlA1, True) & " = """ & cell.Address & "),--(" &
_
rng2.Address(0, 0, xlA1, True) & "=" & cell.Offset(0, 1).Address &
")")

cell.Offset(0, 2).Value = cnt
Next

End Sub

Produces "Type Mismatch" when it gets to cnt=. When I float the mouse
pointer over the .Addresses I get valid ranges and cell locations, but
cnt = 0.

I keep hoping one of these I will understand what I'm seeing and doing.

Bill

 
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
sumif for multi conditions. i.e sumif(A1:A10,"Jon" and B1:B10,"A" Harry Seymour Excel Worksheet Functions 9 June 12th 07 10:47 PM
Embedding a Sumif in a sumif C.Pflugrath Excel Worksheet Functions 5 August 31st 05 07:31 PM
SUMIF jeremy via OfficeKB.com New Users to Excel 2 August 13th 05 01:09 AM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
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 02:46 PM.

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

About Us

"It's about Microsoft Excel"