Workdays function not working

C

Christine

My formula doesn't produce an error, but it doesn't work either! Can someone
help?

DateFrom is the name I've applied to cell N9.

In cell G23 I want to show DateForm - 7 working days, so I've entered this
formula in the cell:
=IF(DateFrom<>"",WORKDAY(DateFrom,-7),"")

Can someome tell me what's is wrong with this syntax? (Analysis Toolpack is
installed.)

Many thanks!
 
D

David Biddulph

Nothing wrong with the syntax.

It's always easier for people to help you if you tell us the symptoms,
rather than just "It doesn't work". What value does the formula give you?
Are you sure that you haven't got a typo? (For example, in your message you
had DateForm once and DateFrom twice).

What do you get if you put =DateFrom into a spare cell? What do you get if
you put =N9? What do you get if you put =WORKDAY(DateFrom,-7)?

Are you sure you've got the calculation mode set to automatic? What happens
if you do an F9?
 
C

Christine

Thanks for responding, David. No, there isn't a typo in the formula - it is
=IF(DateFrom<>"",WORKDAY(DateFrom,-7),"")

The error I'm getting says "#NAME?".

As mentioned, I do have the Analysis tool pack installed. I've also tryed
ticked Tools/Options/Calculation/"Accept labels in formulas". I've verified
that the label "DateFrom" exists as well.
 
A

Arvi Laanemets

Hi

What do you get, when you enter the formula
=DateFrom
into any free cell. I'm afraid it too will be "#NAME". When yes, then check
your name definition - probably it's corrupted (p.e. you deleted the cell
N9, or row/column with it, accidentally).
 
D

driller2

hi, maybe i am confused, but lets try this,

=IF(DateFrom<>"",IF(OR(WEEKDAY(DateFrom)=1,WEEKDAY(DateFrom)=7),WORKDAY(DateFrom,-7),WORKDAY(DateFrom,-7)+1))

happy holidays hohoho:)
romelsb on banter
 
R

Ron Rosenfeld

Thanks for responding, David. No, there isn't a typo in the formula - it is
=IF(DateFrom<>"",WORKDAY(DateFrom,-7),"")

The error I'm getting says "#NAME?".

As mentioned, I do have the Analysis tool pack installed. I've also tryed
ticked Tools/Options/Calculation/"Accept labels in formulas". I've verified
that the label "DateFrom" exists as well.

Try the formula:

=WORKDAY(TODAY(),7)

If that, too, gives a NAME error, then Excel doesn't realize that the ATP is
installed.

Try uninstalling and re-installing.

I've read of this happening in the past, but don't recall the reason why.
--ron
 
D

David Biddulph

OK. You said originally that the formula doesn't produce an error, but now
you've told us what error it does produce. What are the answers to the
other questions I asked?

I see that you're talking about "labels in formulas" (which is a facility I
don't normally use), but I wonder whether there is some confusion between
labels and names. What do you see in the "refers to" field if you use
Insert/ Name/ Define and look for DateFrom? What do you see in the
reference field if you use Edit/ Go To/ and select DateFrom? If you are
using a label rather than a defined name, in which cell is the label?

It may also be useful for you to use the Formula Auditing toolbar, select
the cell (G23) which shows the error, & use the "Trace Error" button.

You can find further help on the #NAME? error at:
http://office.microsoft.com/en-us/excel/HP030560001033.aspx?pid=CH010004941033--David Biddulph"Christine" <[email protected]> wrote in messageThanks for responding, David. No, there isn't a typo in the formula - itis> =IF(DateFrom<>"",WORKDAY(DateFrom,-7),"")>> The error I'm getting says "#NAME?".>> As mentioned, I do have the Analysis tool pack installed. I've also tryed> ticked Tools/Options/Calculation/"Accept labels in formulas". I'veverified> that the label "DateFrom" exists as well.>>> "David Biddulph" wrote:>>> Nothing wrong with the syntax.>>>> It's always easier for people to help you if you tell us the symptoms,>> rather than just "It doesn't work". What value does the formula giveyou?>> Are you sure that you haven't got a typo? (For example, in your messageyou>> had DateForm once and DateFrom twice).>>>> What do you get if you put =DateFrom into a spare cell? What do you getif>> you put =N9? What do you get if you put =WORKDAY(DateFrom,-7)?>>>> Are you sure you've got the calculation mode set to automatic? Whathappens>> if you do an F9?>> -->> David Biddulph>>>> "Christine" <[email protected]> wrote in message>> > My formula doesn't produce an error, but it doesn't work either! Can>> > someone>> > help?>> >>> > DateFrom is the name I've applied to cell N9.>> >>> > In cell G23 I want to show DateForm - 7 working days, so I've enteredthis>> > formula in the cell:>> > =IF(DateFrom<>"",WORKDAY(DateFrom,-7),"")>> >>> > Can someome tell me what's is wrong with this syntax? (AnalysisToolpack>> > is>> > installed.)>> >>> > Many thanks!>>>>>>
 
D

driller2

Hi to all,
I tried that original posted formula of christine and it indeeds giv
me a result on excel 2003, yet i am still blinded by the two differen
results.

if Datefrom is typed as a date that falls on saturday or sunday (thi
is a non-workday)
and if Datefrom is typed as a date that falls on friday.

maybe i am confused. When does the -7 starts deducting?
maybe Christine can give an example.

happy holidays hohoho
romelsb:
 
D

daddylonglegs

Hello driller2

=WORKDAY(A1,-1) would give you the previous workday so if A1 is a Saturday
or a Sunday it gives the previous Friday, similarly

=WORKDAY(A1,-7) gives the Thursday of the week before if A1 is a Saturday or
Sunday.
 
Top