SOLVED

# Help with Excel - Calculating 2 cells based on the text within another

Copper Contributor

# Help with Excel - Calculating 2 cells based on the text within another

Hello ! I hope someone can help me :)

My issue is, I need to calculate the multiplication of 2 cells, when a completely different cell returns a specific text.

Eg:

Cell A = 10

Cell B = 5

Cell C = HAT

Cell D = (this is the cell I want to run the calculation of Cell A* Cell B - but only if Cell C = HAT

if Cell C were to = "Trousers" I would not want the calculation to occur.

Your help would be greatly appreciated !!!

7 Replies

# Re: Help with Excel - Calculating 2 cells based on the text within another

``=IF(C1="HAT",A1*B1,IF(C1="Trousers","",""))``

You can try this nested IF formula.

best response confirmed by Hans Vogelaar (MVP)
Solution

# Re: Help with Excel - Calculating 2 cells based on the text within another

Perhaps

``=IF(C1="HAT", A1*B1, "")``

# Re: Help with Excel - Calculating 2 cells based on the text within another

This was so fast ... Thank you so much for the quick response.. This formula worked perfectly.
Thank you so very much.

# Re: Help with Excel - Calculating 2 cells based on the text within another

Thank you Sergei - This also works perfectly.. very much appreciated.

# Re: Help with Excel - Calculating 2 cells based on the text within another

Apologies to be incredibly annoying but I have an extension to that issue.. are you able to assist?

Your formula works great but now i have a simple sum in the next field which is now returning a #value error..

# Re: Help with Excel - Calculating 2 cells based on the text within another

Cancel that - I've worked it out.

# Re: Help with Excel - Calculating 2 cells based on the text within another

Great to know. If you share result that will be useful for other people in the community.

1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

# Re: Help with Excel - Calculating 2 cells based on the text within another

Perhaps

``=IF(C1="HAT", A1*B1, "")``