Simple IF Statement

EvansB2

Board Regular
Joined
Nov 25, 2008
Messages
245
Office Version
  1. 365
Platform
  1. Windows
Hi there,

In cell C2 (green) I have the following basic formula =IF(C2<B2,C2,B2). I would like to add another argument that if no entry is put in cell B2, then cell A2 is returned instead of "0".

Any assistance would be greatly recieved.

Regards

Ben

[TABLE="width: 241"]
<colgroup><col width="29" style="width: 22pt; mso-width-source: userset; mso-width-alt: 1060;"> <col width="64" style="width: 48pt; mso-width-source: userset; mso-width-alt: 2340;" span="2"> <col width="85" style="width: 64pt; mso-width-source: userset; mso-width-alt: 3108;"> <col width="78" style="width: 59pt; mso-width-source: userset; mso-width-alt: 2852;"> <tbody>[TR]
[TD="class: xl63, width: 29, bgcolor: transparent"] [/TD]
[TD="class: xl64, width: 64, bgcolor: #D9D9D9"]A[/TD]
[TD="class: xl64, width: 64, bgcolor: #D9D9D9"]B[/TD]
[TD="class: xl64, width: 85, bgcolor: #D9D9D9"]C[/TD]
[TD="class: xl64, width: 78, bgcolor: #D9D9D9"]D[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]1[/TD]
[TD="class: xl69, width: 64, bgcolor: #B4C6E7"]Residual life[/TD]
[TD="class: xl69, width: 64, bgcolor: #B4C6E7"]Residual Life Override[/TD]
[TD="class: xl69, width: 85, bgcolor: #B4C6E7"]Confirmed residual life[/TD]
[TD="class: xl68, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]2[/TD]
[TD="class: xl63, bgcolor: transparent"]5[/TD]
[TD="class: xl63, bgcolor: transparent"]3[/TD]
[TD="class: xl70, width: 85, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E2EFDA]#E2EFDA[/URL] , align: right"]3[/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]3[/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]4[/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Your formula cut off. Probably because of greater than or less than symbols...try using PHP tags to post your formula again. Also, explain a little more what you want to happen in C2.

BTW, if the formula is in C2, and the beginning of the formula is:

=IF(C2

that's going to be circular, and is likely to cause you problems.
 
Upvote 0
Thank you. Not sure why my browser didn't show all that.

The problem remains though...if you put that formula in cell C2, you're going to have problems.
 
Upvote 0
Thank you. Not sure why my browser didn't show all that.

Mine doesn't either, but if you reply with quote, then click "Switch Editor to Source Mode" (the A/A button on the left of the tool bar), you can usually see the formulas when they get cut off like that.
 
Last edited:
Upvote 0
Hi there,

In cell C2 (green) I have the following basic formula =IF(C2<b2,c2,b2). i="" would="" like="" to="" add="" another="" argument="" that="" if="" no="" entry="" is="" put="" in="" cell="" b2,="" then="" a2="" returned="" instead="" of="" "0".

Any assistance would be greatly recieved.

Regards

Ben

[TABLE="width: 241"]
<tbody>[TR]
[TD="class: xl63, width: 29, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 64, bgcolor: #D9D9D9"]A[/TD]
[TD="class: xl64, width: 64, bgcolor: #D9D9D9"]B[/TD]
[TD="class: xl64, width: 85, bgcolor: #D9D9D9"]C[/TD]
[TD="class: xl64, width: 78, bgcolor: #D9D9D9"]D[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]1[/TD]
[TD="class: xl69, width: 64, bgcolor: #B4C6E7"]Residual life[/TD]
[TD="class: xl69, width: 64, bgcolor: #B4C6E7"]Residual Life Override[/TD]
[TD="class: xl69, width: 85, bgcolor: #B4C6E7"]Confirmed residual life[/TD]
[TD="class: xl68, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]2[/TD]
[TD="class: xl63, bgcolor: transparent"]5[/TD]
[TD="class: xl63, bgcolor: transparent"]3[/TD]
[TD="class: xl70, width: 85, align: right"]3[/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]3[/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #D9D9D9"]4[/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[TD="class: xl63, bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]


</b2,c2,b2).>

Now we're getting somewhere, I think. In any cell other than A2, B2 or C2, that would be something like this:

PHP:
=IF(B2="",A2,IF(C2<b2,c2,b2)

EDIT: Now I did it, lol. Sorry...complete formula should show now.<b2,c2,b2)<b2,c2,b2))< html=""></b2,c2,b2)<b2,c2,b2))<>
 
Last edited:
Upvote 0
Try:
Code:
=IF(LEN(B2),MIN(B2,C2),A2)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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