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.

A
B
C
1
-9
oil
oil (if A is negative, give the text contained in B; if A is >=0, give 0)
2
7
gas
gas (if A is positive, give the text contained in B; if A is <=0, give 0)
3
0
0
0 (if A is zero, give 0)

<tbody>
</tbody>

I hope I was clear.
Thanks,
Amanda
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,214,636
Messages
6,120,664
Members
448,976
Latest member
sweeberry

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