multiply if

Hi everybody,
I need to compare two rows of text and multiply the values if the text matches. It would be something like SUMIF, but with multiply instead of sum. For example:

mouse- 1 monitor- 30 mouse- 10*1
keyboard- 2 mouse- 10 keyboard- 15*2
monitor- 1 keyboard- 15 monitor- 30*1

I want it to work like SUMIF, compare the first two ranges and multiply the corresponding values.
Thank you very much for your help!

Your question is not very

Your question is not very well explained but, if I correctly understood your needs...
Try using SUMPRODUCT
If the two text you want to compare are in cell A1 and B1 and the two values you want to multiply are in cell C1 and D1 try the following:
=SUMPRODUCT((A1=B1)+0, C1*D1)