Hello: For two worksheets: Sheet1 and Sheet2:
Sheet1:
Code# Total Cost Charges Incurred 1 100 1 200 1 100 2 50 5 50 5 300
Sheet2:
Code# Chargeable? 1 2 Yes 3 4 5 Yes 6 Yes
If cell A2 (Sheet1) is equal to a value in Column A (Sheet2) [Sheet2!A:A] and there is a corresponding value of "Yes" in cell B2 (Sheet2), then display the value in B2 (Sheet1) in cell C2 (Sheet1).
Looking for a formula to be copied into Sheet 1, Column C (Charges Incurred):
I want Excel to see if the "Code" values match on Sheet1 and Sheet2, and Sheet2 also has a value of "Yes" for the corresponding row, then incur the cost in Column C (Sheet1). If it doesn't say "Yes," then put "0."
In other words, if the Codes match, and there is a value of "Yes" in Column B (Sheet2), then incur the full cost of Column B (Sheet1) in Column C (Sheet1).
Formulas I tried that did not work:
"=IF(MATCH(A2, Sheet2!A:A, 0), B2, 0)" This lists everything and does not take into account the constraint to only copy over if the value is "Yes."
"=IF(VLOOKUP(A2, Sheet2!$A$2:$B$7, 2, 0), C2, 0)" Ironically worked for the cells that did not read "Yes," but it did not work for the values that read "Yes," instead I received the error: "#VALUE!" for the "Yes" cells.
Sorry for the weird example. I know what I want to do but cannot seem to convey it logically. I work for a pretty backwards company and some of the services we perform are gratis. This formula would help immensely and auto-fill about ~3500 cells for me! Thank you in advance for your help!
Bookmarks