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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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