Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am calculating sick day accrual.
It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi.
=MIN(SUM(B5:M5),24) -- HTH :) Dana DeLouis Windows XP & Office 2003 "phooey" wrote in message ... I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this:
=MIN(SUM(B5:M5),24) HTH, Elkar "phooey" wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Didn't work. It returns a value of '0' (zero).
Here's what I'm using it on (using my formula) The employee SS I tested this on has 12 accrued hours over 4 months. ie) b5=4, c5=4, d5=4, e5=4, and f5-m5 are all 0 As I add hours to colums f-m it increases the total, to a max of 24. When I use your formula it returns 0. Ideas? p.s. thanks for helping :-) "Elkar" wrote: Try this: =MIN(SUM(B5:M5),24) HTH, Elkar "phooey" wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
BAH!!!
I entered your formula on the worng line.. hence the 0 return **smacks self in head** When I use your formula on the correct line.. hence b5 on line 5, and not line 8 *smacks self again* it works great. Thanks again!! And thanks to everyone else who posted.... :-) "phooey" wrote: Didn't work. It returns a value of '0' (zero). Here's what I'm using it on (using my formula) The employee SS I tested this on has 12 accrued hours over 4 months. ie) b5=4, c5=4, d5=4, e5=4, and f5-m5 are all 0 As I add hours to colums f-m it increases the total, to a max of 24. When I use your formula it returns 0. Ideas? p.s. thanks for helping :-) "Elkar" wrote: Try this: =MIN(SUM(B5:M5),24) HTH, Elkar "phooey" wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Bah!!! ** Smacks self in head ** I put the formula on the wrong line. When I put your formula on the correct line... ie B5 on line 5, and not line 8, it works great *smacks self again* Thanks again for your help, and thanks to everyone for your quick replies. :-) "phooey" wrote: Didn't work. It returns a value of '0' (zero). Here's what I'm using it on (using my formula) The employee SS I tested this on has 12 accrued hours over 4 months. ie) b5=4, c5=4, d5=4, e5=4, and f5-m5 are all 0 As I add hours to colums f-m it increases the total, to a max of 24. When I use your formula it returns 0. Ideas? p.s. thanks for helping :-) "Elkar" wrote: Try this: =MIN(SUM(B5:M5),24) HTH, Elkar "phooey" wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Perhaps your numbers are stored as a Text format rather than Number. This
would explain why the SUM function ignores them. Try this instead: =MIN(SUM(VALUE(B5:M5)),24) This is an array formula, and must be entered with CTRL-SHIFT-ENTER instead of just Enter. If done properly, the formula should be surrounded by { }. HTH, Elkar "phooey" wrote: Didn't work. It returns a value of '0' (zero). Here's what I'm using it on (using my formula) The employee SS I tested this on has 12 accrued hours over 4 months. ie) b5=4, c5=4, d5=4, e5=4, and f5-m5 are all 0 As I add hours to colums f-m it increases the total, to a max of 24. When I use your formula it returns 0. Ideas? p.s. thanks for helping :-) "Elkar" wrote: Try this: =MIN(SUM(B5:M5),24) HTH, Elkar "phooey" wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think our posts 'crossed in the mail' and you missed my earlier reply.
here it is... /quote/ Bah!!! ** Smacks self in head ** I put the formula on the wrong line. When I put your formula on the correct line... ie B5 on line 5, and not line 8, it works great *smacks self again* Thanks again for your help, and thanks to everyone for your quick replies. :-) /unquote/ Im such a goof.... I can't believe I forgot to change the numbers to coincide with the line I was working on.... Thanks again.. "Elkar" wrote: Perhaps your numbers are stored as a Text format rather than Number. This would explain why the SUM function ignores them. Try this instead: =MIN(SUM(VALUE(B5:M5)),24) This is an array formula, and must be entered with CTRL-SHIFT-ENTER instead of just Enter. If done properly, the formula should be surrounded by { }. HTH, Elkar "phooey" wrote: Didn't work. It returns a value of '0' (zero). Here's what I'm using it on (using my formula) The employee SS I tested this on has 12 accrued hours over 4 months. ie) b5=4, c5=4, d5=4, e5=4, and f5-m5 are all 0 As I add hours to colums f-m it increases the total, to a max of 24. When I use your formula it returns 0. Ideas? p.s. thanks for helping :-) "Elkar" wrote: Try this: =MIN(SUM(B5:M5),24) HTH, Elkar "phooey" wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try =IF(SUM(B5:M5)=24,24,SUM(B5:M5))
or, without IF and even shorter MIN(SUM(B5:M5),24) best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "phooey" wrote in message ... I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=MIN(SUM(B5:M5),24)
-- Kind regards, Niek Otten Microsoft MVP - Excel "phooey" wrote in message ... |I am calculating sick day accrual. | It's cumulative and adds hours each month, to a max of 24 hours. | | Here's what I have, and it works: | =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) | | I would like to make this shorter. | I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. | | Ideas?? | | I Know.. if it's not broke don't fix it. | But I know there has to be an easier/shorter way..... | | |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
=MIN(24,SUM(B5:M5)) Regards, Peo Sjoblom phooey wrote: I am calculating sick day accrual. It's cumulative and adds hours each month, to a max of 24 hours. Here's what I have, and it works: =IF(B5+C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5=24,24,B5+ C5+D5+E5+F5+G5+H5+I5+J5+K5+L5+M5) I would like to make this shorter. I've tried using: =IF(B5:M5=24,24,B5:M5), but it errors. Ideas?? I Know.. if it's not broke don't fix it. But I know there has to be an easier/shorter way..... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find value in array | Excel Worksheet Functions | |||
Is it possible? | Excel Worksheet Functions | |||
Reusing formula | Excel Discussion (Misc queries) | |||
sumproduct formula too long, & how to use make an 'OR' statement w | Excel Worksheet Functions | |||
how do I make a formula NOT change when the data range is moved? | Excel Discussion (Misc queries) |