ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   creating formula using if function (https://www.excelbanter.com/excel-worksheet-functions/52073-creating-formula-using-if-function.html)

juvena

creating formula using if function
 
I confused about creating formula using if function for the condition below.

Labor costs for items with material costs of at least $100 but less than
$500 are estimated at 50% of material costs.

I tried everything but did not work please help

(for example A1 contains a material cost) =if(A1=100<500,A1*0.50) isn't
that correct?


Paul Sheppard

creating formula using if function
 

juvena Wrote:
I confused about creating formula using if function for the condition
below.

Labor costs for items with material costs of at least $100 but less
than
$500 are estimated at 50% of material costs.

I tried everything but did not work please help

(for example A1 contains a material cost) =if(A1=100<500,A1*0.50)
isn't
that correct?


Hi juvena

Try this =IF(AND(A1=100,A1<=500),A1*0.5,"")


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=479027


[email protected]

creating formula using if function
 
"juvena" wrote:
(for example A1 contains a material cost) =if(A1=100<500,A1*0.50)
isn't that correct?


It is "correct" in the syntactic sense. But it certainly does not
mean what you think it does.

(It also does not mean what I think it should!)

Besides, it is almost never a good idea to omit the "else" part --
the 3rd parameter of an IF() function, what Excel calls the
"value_if_false" part. If you do, you can get mixed results: a
numerical value in one case (A1*0.50), a boolean value (FALSE)
in another case.

I confused about creating formula using if function for the condition below.
Labor costs for items with material costs of at least $100 but less than
$500 are estimated at 50% of material costs.


And what are the labor costs when material costs are less than
$100 or not less than $500?

The formula you should want is something like:

=IF(A1 < 100,
A1*(factor if labor less than $100),
IF(AND(100<=A1,A1<500),
A1*50%,
A1*(factor if labor not less than 500) ) )

I wrote that the "hard way" so that you could see how the
AND() function works -- the solution you are probably looking
for. But it could be written somewhat more simply, namely:

=IF(A1 < 100,
A1*(factor if labor less than $100),
IF(A1 = 500,
A1*(factor if labor not less than 500),
A1*50%) )




All times are GMT +1. The time now is 11:32 PM.

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