ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do I create a if-then formula? (https://www.excelbanter.com/excel-worksheet-functions/24686-how-do-i-create-if-then-formula.html)

karen

how do I create a if-then formula?
 
I need to create a formula in which if column a is bigger then b, then
subtract the two columns and multiply by 3%, or if column b is bigger then
find the difference and multiple by 5%.

bj

In C1 enter
=if(A1B1,(A1-B1)*.03,(B1-A1)*.05)
You should format it as %


"karen" wrote:

I need to create a formula in which if column a is bigger then b, then
subtract the two columns and multiply by 3%, or if column b is bigger then
find the difference and multiple by 5%.


CLR

=MAX((A1-B1)*3%,(B1-A1)*5%)

Vaya con Dios,
Chuck, CABGx3


"karen" wrote in message
...
I need to create a formula in which if column a is bigger then b, then
subtract the two columns and multiply by 3%, or if column b is bigger then
find the difference and multiple by 5%.




bj

Very nice

"CLR" wrote:

=MAX((A1-B1)*3%,(B1-A1)*5%)

Vaya con Dios,
Chuck, CABGx3


"karen" wrote in message
...
I need to create a formula in which if column a is bigger then b, then
subtract the two columns and multiply by 3%, or if column b is bigger then
find the difference and multiple by 5%.





CLR

Thanks for the compliment.............of course it's not an "IF" statement
like the OP requested, but it seemed to be an interesting
alternative..........

Vaya con Dios,
Chuck, CABGx3


"bj" wrote in message
...
Very nice

"CLR" wrote:

=MAX((A1-B1)*3%,(B1-A1)*5%)

Vaya con Dios,
Chuck, CABGx3


"karen" wrote in message
...
I need to create a formula in which if column a is bigger then b, then
subtract the two columns and multiply by 3%, or if column b is bigger

then
find the difference and multiple by 5%.








All times are GMT +1. The time now is 07:09 AM.

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