ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF function? (https://www.excelbanter.com/excel-worksheet-functions/25537-if-function.html)

Murph

IF function?
 
I read a post below about using the "if" function for multiple calculations
inside of 1 formula, but I did not quite understand your responses.

My issue is taking 13 values from say cell "L3" and multiplying that value
by a specified formula:
=IF(L3=4,D3+50,IF(L3=6,D3*1.5+50,IF(L3=8,D3*2+50,I F(L3=10,D3*2.5+50,IF(L3=12,D3*3+50,IF(L3=14,D3*3.5 +50,IF(L3=16,D3*4+50,IF(L3=18,D3*4.5+50,))))))))
Problem being I have 5 more values to add 20,22,24,26,28 how do I do this?
It appeared to me that I needed to incorporate the "or" function but when I
did this it returned an error. Thanks in advance

Vasant Nanavati

=IF(AND(L3=4,L3<=28,MOD(L3,2)=0),50+(D3*L3/4),"ERROR")

--

Vasant


"Murph" wrote in message
...
I read a post below about using the "if" function for multiple

calculations
inside of 1 formula, but I did not quite understand your responses.

My issue is taking 13 values from say cell "L3" and multiplying that value
by a specified formula:

=IF(L3=4,D3+50,IF(L3=6,D3*1.5+50,IF(L3=8,D3*2+50,I F(L3=10,D3*2.5+50,IF(L3=12
,D3*3+50,IF(L3=14,D3*3.5+50,IF(L3=16,D3*4+50,IF(L3 =18,D3*4.5+50,))))))))
Problem being I have 5 more values to add 20,22,24,26,28 how do I do this?
It appeared to me that I needed to incorporate the "or" function but when

I
did this it returned an error. Thanks in advance




Murph

what does the "mod" function do in this formula? the rest I understand.

"Vasant Nanavati" wrote:

=IF(AND(L3=4,L3<=28,MOD(L3,2)=0),50+(D3*L3/4),"ERROR")

--

Vasant


"Murph" wrote in message
...
I read a post below about using the "if" function for multiple

calculations
inside of 1 formula, but I did not quite understand your responses.

My issue is taking 13 values from say cell "L3" and multiplying that value
by a specified formula:

=IF(L3=4,D3+50,IF(L3=6,D3*1.5+50,IF(L3=8,D3*2+50,I F(L3=10,D3*2.5+50,IF(L3=12
,D3*3+50,IF(L3=14,D3*3.5+50,IF(L3=16,D3*4+50,IF(L3 =18,D3*4.5+50,))))))))
Problem being I have 5 more values to add 20,22,24,26,28 how do I do this?
It appeared to me that I needed to incorporate the "or" function but when

I
did this it returned an error. Thanks in advance





JE McGimpsey

Did you look it up in XL Help? It's description is pretty good...

MOD divides the first argument by the second argument and returns the
remainder.

In article ,
"Murph" wrote:

what does the "mod" function do in this formula? the rest I understand.


Vasant Nanavati

In this particular case, it ensures that L3 is an even number.

--

Vasant


"Murph" wrote in message
...
what does the "mod" function do in this formula? the rest I understand.

"Vasant Nanavati" wrote:

=IF(AND(L3=4,L3<=28,MOD(L3,2)=0),50+(D3*L3/4),"ERROR")

--

Vasant


"Murph" wrote in message
...
I read a post below about using the "if" function for multiple

calculations
inside of 1 formula, but I did not quite understand your responses.

My issue is taking 13 values from say cell "L3" and multiplying that

value
by a specified formula:


=IF(L3=4,D3+50,IF(L3=6,D3*1.5+50,IF(L3=8,D3*2+50,I F(L3=10,D3*2.5+50,IF(L3=12
,D3*3+50,IF(L3=14,D3*3.5+50,IF(L3=16,D3*4+50,IF(L3 =18,D3*4.5+50,))))))))
Problem being I have 5 more values to add 20,22,24,26,28 how do I do

this?
It appeared to me that I needed to incorporate the "or" function but

when
I
did this it returned an error. Thanks in advance







Murph

okay with that being said, what exactly is it doing in this formula?

"JE McGimpsey" wrote:

Did you look it up in XL Help? It's description is pretty good...

MOD divides the first argument by the second argument and returns the
remainder.

In article ,
"Murph" wrote:

what does the "mod" function do in this formula? the rest I understand.



bj

it looks like you could use
=50+D3*L3/4 for this calculation

"Murph" wrote:

I read a post below about using the "if" function for multiple calculations
inside of 1 formula, but I did not quite understand your responses.

My issue is taking 13 values from say cell "L3" and multiplying that value
by a specified formula:
=IF(L3=4,D3+50,IF(L3=6,D3*1.5+50,IF(L3=8,D3*2+50,I F(L3=10,D3*2.5+50,IF(L3=12,D3*3+50,IF(L3=14,D3*3.5 +50,IF(L3=16,D3*4+50,IF(L3=18,D3*4.5+50,))))))))
Problem being I have 5 more values to add 20,22,24,26,28 how do I do this?
It appeared to me that I needed to incorporate the "or" function but when I
did this it returned an error. Thanks in advance


JE McGimpsey

It returns the remainder of L3 divided by 2.

Going beyond what MOD() is doing, that result is then compared to zero,
returning a TRUE/FALSE result. TRUE would indicate that the value of L3
is both integral and even. FALSE would indicate that it is not integral
and even.

That result is an input to the AND() function. If L3 is not integral and
even, the AND() function will return FALSE, and the result of the False
branch of the IF statement (i.e., "ERROR") will be returned to the cell.



In article ,
"Murph" wrote:

okay with that being said, what exactly is it doing in this formula?



All times are GMT +1. The time now is 11:10 AM.

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