Can I use IF function to use a formula if true and another formula if false

dougkpga

New Member
Joined
Apr 15, 2016
Messages
8
Hi

I have a condition that either returns a profit or does not return a profit.

So if there is a sale, column A = S.
If there is no sale, column A = NS

If there is a sale then the return (column D) is price (Column B)*quantity (number of units) (Column C)
If no sale then the return is 0 (zero)

So using IF function I tried the following -

=IF(A1=S,"B1*C1","0")

=IF(A1=S,(B1*C1),0))

=IF(A1=S,(B1*C1),"0")

None of which gave me either the return or the zero.

Can anyone help please?

Much appreciated.

Thanks in advance Doug
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You are a bit confused in your use of double-quotes. You put them around literal text values only, not range references.
So try:
Code:
[COLOR=#333333]=IF(A1="S",B1*C1,0)[/COLOR]
 
Upvote 0
You are right about my confusion with the double quotes. Thanks to both of you for the quick replies. Thanks given under posts.
 
Upvote 0
I have been asked if I could modify the spreadsheet a little bit.


So now I have 3 conditions that either return a projected profit or does not return a profit.

So if there is a sale, column A = S
If there is a conditional promise to order A = C (conditional)
If there is no sale, column A = NS

If there is a sale (S) or conditional sale (C) then the projected return (column D) is price (Column B)*quantity (number of units) (Column C)
If no sale then the return is 0 (zero)


=IF(A1="S",B1*C1,0)

My attempt was ....

=IF(A1="S",B1*C1,IF(AND(A1="C",B1*C1,0)))

but it didn't work.



Once again thanks in advance for any help

Doug
 
Upvote 0
Hmmm....

This wouldn't be homework, would it?
 
Upvote 0
No sir. At age 61 I am done with homework.
OK. Just checking. You are never too old to learn, though!;)

You would be surprised how often people expect us to do their homework for them!
 
Upvote 0

Forum statistics

Threads
1,215,400
Messages
6,124,702
Members
449,180
Latest member
craigus51286

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