ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Month in formula (https://www.excelbanter.com/excel-worksheet-functions/257659-month-formula.html)

Smilingmom

Month in formula
 
I have a formula where I calculate the number of hour accrued based on the
month of the year. Currently, I have to physically go in and change the
number. Is there a formula I can add to this to make it change automatically
based on the current month? The formula is below where X is the current
month (number).

=(6.67*X)-0.04

Thanks for the help!



Joe User[_2_]

Month in formula
 
"Smilingmom" wrote:
Is there a formula I can add to this to make it
change automatically based on the current month?


Yes.


The formula is below where X is the current
month (number).
=(6.67*X)-0.04


The precise answer depends on what "X" is.

If "X" is a reference to a cell that contains a date serial number (i.e. a
bona date, not text), then perhaps:

=6.67*MONTH(A1)-0.04

But if "X" is simply a relative position in a column starting with A1, then
perhaps:

=6.67*(ROW()-ROW($A$1))-0.04

Aside.... You might want to reconsider the use of decimal fractions like
..67 and 0.04. If those dollar-and-cents fails, fine. But if they are your
approximations for rational fractions, it would be better to use the rational
fractions, perhaps explicitly rounding the result to dollars and cents. For
example:

=ROUND((6+2/3)*MONTH(A1) - 1/25, 2)


----- original message -----

"Smilingmom" wrote:
I have a formula where I calculate the number of hour accrued based on the
month of the year. Currently, I have to physically go in and change the
number. Is there a formula I can add to this to make it change automatically
based on the current month? The formula is below where X is the current
month (number).

=(6.67*X)-0.04

Thanks for the help!



Dave Peterson

Month in formula
 
The x values can be 1 to 12?

=(6.67*month(today())-0.04



Smilingmom wrote:

I have a formula where I calculate the number of hour accrued based on the
month of the year. Currently, I have to physically go in and change the
number. Is there a formula I can add to this to make it change automatically
based on the current month? The formula is below where X is the current
month (number).

=(6.67*X)-0.04

Thanks for the help!


--

Dave Peterson

T. Valko

Month in formula
 
Try this...

=6.67*MONTH(NOW())-0.04

--
Biff
Microsoft Excel MVP


"Smilingmom" wrote in message
...
I have a formula where I calculate the number of hour accrued based on the
month of the year. Currently, I have to physically go in and change the
number. Is there a formula I can add to this to make it change
automatically
based on the current month? The formula is below where X is the current
month (number).

=(6.67*X)-0.04

Thanks for the help!






All times are GMT +1. The time now is 10:12 PM.

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