Month in formula

S

Smilingmom

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!
 
J

Joe User

Smilingmom said:
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 -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top