match, lookup two column data
One way ... one LONG way, with an *array* formula,
With the lookup item in C1 and the number to multiply in C2:
=IF(COUNT(IF((A2:A6=C1)*(B2:B6=VLOOKUP(C1,A2:B6,2, 0)),B2:B6))=COUNTIF(A2:A6,C1),VLOOKUP(C1,A2:B6,2,0 )*C2,"Varies")
--
Array formulas are entered using CSE, <Ctrl <Shift <Enter, instead of the
regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, CSE *must* be used when
revising the formula.
--
HTH,
RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===
"KUMPFfrog" wrote in message
...
I want to perform a calculation base off criteria from two columns.
ex:
A B
1 apples 222
2 oranges 156
3 apples 789
4 apples 222
5 oranges 789
if all the 'apples' in column 'A' have the same corrisponding value in
column 'B' then multipy the value in 'B' times some number. In this
example,
ALL the 'apples' do not have 'B' values that match so it will return
"Varies".
Thanks
|