Port a SUMIF from Excel to Calculated Field
I've got an Excel field with =SUMIF(A:A,A1,B:B) , which is to say "Sum all the B column's values for rows in which the A column value appears somewhere in the entire A column". So say "foo" appears in A1, A4, and A9, and B1=10, B4=20, and B9=30 , then the result of the formula is 10+20+30, or 60. A Sharepoint list can't do that (can it?) , i.e. a Calculated Field can't reference other rows or ranges. So what can I do to achieve the same effect? It occurred to me that I might break out the redundant A column into a separate list (kind of like normalizing, in database terms), and make it a lookup field. That would work if I had apple,60 in one row. But if I had apple,10 ; apple,20 ; apple,30 in three rows, there's no way to look up the sum, is there?
April 29th, 2011 3:27pm

Actually the lookup field wouldn't give me the relationality I'm looking for, as I'm working on this in MOSS. I think it's there in 2010. So then ... I'm not sure it would help anyway. Can anything be done along these lines in SPD views with XSLT? Probably headed in that direction. Use jquery to iterate through the list and create an array of the label-sum pairs I require (apple, 60; banana 75; cherry 100) then fill my field? Sounds a little wacky.
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2011 3:58pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics