if statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I am just learning Excel and I am having problems with formula's. Especially the IF statement

I want to first add up the cells A1 to A8 and show the total in A9 then if the total is greater than 48 I want A10 to show the amount greater than 48 with the text Overtime next to it. If the amount is less than 48 I want the cell A10 to be empty

Hope someone can help
 
bobby

In A9 put:
=MIN(SUM(A1:A8),48)
In A10 put:
=IF(SUM(A1:A8)>48,SUM(A1:A8)-48&"Overtime","")

Andy

bobby said:
Hello,

I am just learning Excel and I am having problems with formula's. Especially the IF statement.

I want to first add up the cells A1 to A8 and show the total in A9 then if
the total is greater than 48 I want A10 to show the amount greater than 48
with the text Overtime next to it. If the amount is less than 48 I want the
cell A10 to be empty.
 
In A9 put:
=MIN(SUM(A1:A8),48)

Read the OP as meaning he wanted:

In A9: =SUM(A1:A8)

If so, then, maybe

In A10: =IF(A9>48,A9-48&" Overtime","")
(which of course gives the same return as your suggested formula)
--
hth
Max
-----------------------------------------
Please reply in newsgroup

Use xdemechanik
<at>yahoo<dot>com
for email
-------------------------------------------
 
Bobby,

Put this formula in cell A9: =SUM(A1:A8)
and this one in cell A10: =IF(A9>48,A9-48 & " Overtime","")

The IF function has three arguments, which are separated by commas.
The first argument is the test, the second argument is what to return if
the test is true and the third argument is what to return if the test is
false.

If you replace the first comma with "THEN SHOW" and the second
comma with "OTHERWISE SHOW", the formula will be kind of
understandable:

IF A9>48 then show A9-48 & " Overtime" otherwise show ""


The & operator is used to concatenate ("glue together") pieces of text.

A9-48 & " Overtime" first calculates the difference between the value of
cell A9 and 48. Lets assusme that A9 holds the value 55 and the result is
therefore 7. Then it concatenates this 7 with the text string " Overtime",
and the returned value will be "7 Overtime".

Ture Magnusson
Karlstad, Sweden

bobby said:
Hello,

I am just learning Excel and I am having problems with formula's. Especially the IF statement.

I want to first add up the cells A1 to A8 and show the total in A9 then if
the total is greater than 48 I want A10 to show the amount greater than 48
with the text Overtime next to it. If the amount is less than 48 I want the
cell A10 to be empty.
 
Thank you all. I understand some of excel but I just find it difficult to know where to put the brackets and comma's ect

Bobby
 
Back
Top