If cell contains multiple text how to add other cell value?

Solved
Report
-
Posts
2847
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 13, 2022
-
Hello,

I am struggeling with my excel sheet and need help. I will rather give it in an example.

A1 and B1 contains a price, C1 contains three seperate text rules and D1 is where i struggle.

This is what I would like to do.
If the text in cell C1 is A it should add Cell A1's price in cell D1 as a minus, if C1 is B it should add Cell B1's price in cell D1, if C1 is AB it should add Cell B1's price ÷ 2 in cell D1.

Example:
A1 B1 C1 D1
$1.00 $0.76 A -$1.00
$1.00 $0.76 B $0.76
$1.00 $0.76 AB $0.38.

I do hope my explanation makes sense.

Regards
Iza

System Configuration: Android / Chrome 96.0.4664.45

1 reply

Posts
2847
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 13, 2022
491
Hi Iza,

Give the following formula a try:
=IF(C1="A",A1*-1,IF(C1="B",B1,IF(C1="AB",B1/2,"")))

Best regards,
Trowa