ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If statement (https://www.excelbanter.com/excel-worksheet-functions/241927-if-statement.html)

meggie

If statement
 
Hi Everyone,
I am having trouble getting my formula to follow my logic!

I want the cell to follow the logic of:
If AG360,then enter AL28-AG36,however if AL28-AG36<0 then enter 0
I currently have
=IF(AG360,AG36-AL28,AL28), IF(AG36-AL28<0,0,AG36-AL28)

My logic is not following how it should be and I am getting a Value error.

Thanks in advance!
Cheers,
Meg

Rick Rothstein

If statement
 
I think this formula does what you want...

=IF(AG360,MAX(0,AG36-AL28),AL28)

--
Rick (MVP - Excel)


"meggie" wrote in message
...
Hi Everyone,
I am having trouble getting my formula to follow my logic!

I want the cell to follow the logic of:
If AG360,then enter AL28-AG36,however if AL28-AG36<0 then enter 0
I currently have
=IF(AG360,AG36-AL28,AL28), IF(AG36-AL28<0,0,AG36-AL28)

My logic is not following how it should be and I am getting a Value error.

Thanks in advance!
Cheers,
Meg



Jacob Skaria

If statement
 
Your description and formula do not match. As per your description

"If AG360,then enter AL28-AG36,however if AL28-AG36<0 then enter 0" try the
below

=IF(AG360,MAX(0,AL28-AG36))

If this post helps click Yes
---------------
Jacob Skaria


"meggie" wrote:

Hi Everyone,
I am having trouble getting my formula to follow my logic!

I want the cell to follow the logic of:
If AG360,then enter AL28-AG36,however if AL28-AG36<0 then enter 0
I currently have
=IF(AG360,AG36-AL28,AL28), IF(AG36-AL28<0,0,AG36-AL28)

My logic is not following how it should be and I am getting a Value error.

Thanks in advance!
Cheers,
Meg


Jacob Skaria

If statement
 
and the FALSE statement goes as AL28

=IF(AG360,MAX(0,AL28-AG36),AL28)

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Your description and formula do not match. As per your description

"If AG360,then enter AL28-AG36,however if AL28-AG36<0 then enter 0" try the
below

=IF(AG360,MAX(0,AL28-AG36))

If this post helps click Yes
---------------
Jacob Skaria


"meggie" wrote:

Hi Everyone,
I am having trouble getting my formula to follow my logic!

I want the cell to follow the logic of:
If AG360,then enter AL28-AG36,however if AL28-AG36<0 then enter 0
I currently have
=IF(AG360,AG36-AL28,AL28), IF(AG36-AL28<0,0,AG36-AL28)

My logic is not following how it should be and I am getting a Value error.

Thanks in advance!
Cheers,
Meg



All times are GMT +1. The time now is 05:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com