series of conditions in the same formula

AmandaSS

Board Regular
Joined
Jan 7, 2014
Messages
133
Hi,
I have the data in A and B, I would like a formula in C that gives as a results the text contained in B, or zero.
Please note that A can be either >, < or =0. In B there is text or value (zero).
The formula in C should be able to recognize whether the value in A is positive/negative or zero, and give as a result the corresponding text (or zero value) contained in C.

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]-9
[/TD]
[TD]oil
[/TD]
[TD]oil (if A is negative, give the text contained in B; if A is >=0, give 0)
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]7
[/TD]
[TD]gas
[/TD]
[TD]gas (if A is positive, give the text contained in B; if A is <=0, give 0)
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0 (if A is zero, give 0)
[/TD]
[/TR]
</tbody>[/TABLE]

I hope I was clear.
Thanks,
Amanda
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,204
Messages
6,170,729
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top