I have two columns of data, one column will have either "cc" or "cash" in each cell, the second column will have $amounts. I am trying to have it automatically know whether each dollar amount is associated with "cc" "cash" other words, whether "cc" or "cash" is in the cell next to the amount. I then would like it to fill the totals from "cash" and "cc" into specified cells.

Any help with this would be greatly appreciated.

Thank you!

1 Answer 1


Assume column A has "cc" or "cash", and column B has the $amount.

To pull the total of B2, only if the value of A2 is "cash", do =if(A2="cash",B2,"").

If you wanted it only for "cc", =if(A2="cc",B2,"").

If you wanted it for either "cc" and "cash", =if(OR(A2="cc", A2="cash"),B2,"").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.