Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Chris
You can use the formula below =SUMPRODUCT(--(B2:B5="A"),ABS(A2:A5)) or you can use this UDF is you prefer VBA: Public Function AbsSumIF(CriteriaRange As Range, Criteria As String, SumRange As Range) As Variant If CriteriaRange.Cells.Count < SumRange.Cells.Count Then AbsSumIF = CVErr(2023) Exit Function End If For Each cell In CriteriaRange c = c + 1 If cell.Value = Criteria Then AbsSumIF = AbsSumIF + Abs(SumRange(c)) End If Next End Function Regards, Per "ckemler" skrev i meddelelsen ... In this example: Value Criteria 1 a -2 a -3 b 4 b I want to sum the absolute values of criteria a and another sum of absolute values of criteria b. I've been researching this and started learning VBA, but I can't get the answer. Does anybody have any insight? Thanks, Chris |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need sum of top values in a range based on criteria | Excel Worksheet Functions | |||
Sum of values based on different criteria | Excel Discussion (Misc queries) | |||
Returning all values based on 2 criteria... | Excel Discussion (Misc queries) | |||
Looking up values based on two criteria | Excel Worksheet Functions | |||
adding values based on criteria | Excel Worksheet Functions |