I am trying to use a if statement and match function to find the cost from the Tab called Cost to the main tab. But I need to match the type and Error (Column B and C) together to find the cost from the cost tab.
Here is my attempt but I got 0, it should be 50.
=IFERROR(VLOOKUP(B2:C2,Cost!A2:C8,MATCH(Main!B2:C2,Cost!A2:B7,0),FALSE),0)
Last edited by Batman11692003; 10-16-2011 at 01:14 PM.
Batman11692003,
Attached is a modified version of your example workbook. In cell D2 of sheet 'Main' is the following formula:
=SUMPRODUCT(--(Cost!$A$2:$A$7=B2),--(Cost!$B$2:$B$7=C2),Cost!$C$2:$C$7)
And then its copied down.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Alternative formula, because you're using a .xlsx file:
=SUMIFS(Cost!$C$2:$C$7,Cost!$A$2:$A$7,B2,Cost!$B$2:$B$7,C2)
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Thanks for your help. But could you explain why I could use if and match function.
How would I leave it blank instead of showing a 0 if there were no values plugged into the cell
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks