View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Criteria problems in the DSUM function

If you want to use the contents in Template!V5 to get a variable you can use
INDIRECT but how you apply it depends on what you want to type into V5, if
you want to type NetData!A1 into Template!V5 you can use

=DSUM(NetData!A1:K313,INDIRECT(Template!V5),NetDat a!L1:L2)

if you want to type in the criteria range into Template!V5 you can use

=DSUM(NetData!A1:K313,"LENGTH",INDIRECT(Template!V 5))

with NetData!L1:L2 in V5 it will return the same as in your first example

I assumed you have a header in A1, anyway INDIRECT would be the way to g

--
Regards,

Peo Sjoblom

(No private emails please)


"AA" wrote in message
...
I have an excel sheet with three worksheets.
1. Database from which the final values is looked from ("NetData")
2. Database that provides the IDs for lookup ("Template")
3. Final sheet where the value is posted

I am performing following ways for DSUM to work
=DSUM(NetData!A1:K313,"LENGTH",NetData!L1:L2)
=DSUM(NetData!A1:K313,"LENGTH","""AASEGNO"&"="&Tem plate!V5&"""")
=DSUM(NetData!A1:K313,"LENGTH",NetData!A1=Template !V5)
=DSUM(NetData!A1:K313,"LENGTH","AASEGNO"=Template! V5)

The variable "Length" is being summed up. The criteria - NetData!L1:L2
works
where the I have manually entered what I have being trying to do in the
three
other ways where I make the value NetData!L2 as to be a variable having a
value that is contained in Template sheet, the only difference is that in
first one I can only enter one value Template!V5. Can anybody help with
why
the last three ways of setting up the criteria is wrong along with the
correction?