Calculating which day from date?

R

roandr

Is there a way to extract which day a specific dato represents?

For example; 14.02.03 = Saturda
 
F

Frank Kabel

Hi
one way:
format the cell as 'DDDD'
or
=TEXT(A1,"dddd")
where A1 stores your date value

Frank
 
R

roandr

That did it though I got the wrong day...

=UKEDAG(B5;2)

14.02.03 gives friday though it's supposed to be saturday...

The name of the function is in norwegian. By the way, is it possible t
change name of functions into english names
 
F

Frank Kabel

Hi
if think you messed up the years :)
14.02.2003 was a friday though
14.02.2004 is a saturday

You can't change the function anmes to english though you may ask
Norman Harker for his function list with translations from/to English

Frank
 
A

A.W.J. Ales

Function ContentUkA1(a As Range)
ContentUkA1 = a.Formula
End Function

Put in a cel the formula =ContentUkA1(Cellref), where Cellref is a cell
containing the function you want translated.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
R

roandr

Frank Kabel;

We in 2004 already!? Damn, where did 2003 go? I bow in awe! :)

---

A.W.J. Ales;

Function ContentUkA1(a As Range)
ContentUkA1 = a.Formula
End Function

I open the VB editor and write this within "ThisWorkbook"? I assume
did this wrong cause I couldn't get it to work..
 
A

A.W.J. Ales

Roandr,

Just enter it in a "normal" module.
It creates a function (UDF : User Defined Function) which will show up in
the Functionwizard as well.
You can create a module by Insert / Module from the menubar from the VBE.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
R

roandr

Auk Ales,

Excellent!

Now for another one;

How do I get my norwegian version of excel to recognize the function
if I use the english syntax
 
P

Peo Sjoblom

You can't, if you get a workbook made with another language version it will
be translated into Norwegian when you open it.
However you can't type in English formulas without getting name errors.
There are translations available to good homes from
Norman Harker

Here's a copy and paste from a post from Norman

"Hi All!

Dutch, German and Portuguese (Brazil) files are now available thanks
to the assistance of Ron de Bruin, Frank Kabel and Orlando Magalhães
Filho.

Translations of Names, Descriptions and Syntax in both directions.
Each is assisted by Help buttons to access the Help file for the
function in the language of the version used.
Plus classification sheets (not translated).

Version 4 now features a translation sheet covering names in Danish,
Dutch, German, Spanish, Finnish, French, Italian, Japanese, Norwegian,
Portuguese, Portuguese (Brazil), Russian and Swedish. Separate sorting
by language and Help buttons to directly access the Help files.

More translators required. Just email and ask. No requests on
newsgroups please.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes."
 
A

A.W.J. Ales

Roandr,

In addition to what Peo allready mentioned : If you however program in VB
you have to use the English names.
That also applies when you write a formula in VB to "put into a cell on a
sheet".
(So if you write in VB the statement : Range("A1").Formula =
"=Weekday(B5,2)" VB "translates" this to "=Ukedag(B5,2)" in cell A1)

So if you want to dive into VB you really need a "translationtable".

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

Peo Sjoblom said:
You can't, if you get a workbook made with another language version it will
be translated into Norwegian when you open it.
However you can't type in English formulas without getting name errors.
There are translations available to good homes from
Norman Harker

Here's a copy and paste from a post from Norman

"Hi All!

Dutch, German and Portuguese (Brazil) files are now available thanks
to the assistance of Ron de Bruin, Frank Kabel and Orlando Magalhães
Filho.

Translations of Names, Descriptions and Syntax in both directions.
Each is assisted by Help buttons to access the Help file for the
function in the language of the version used.
Plus classification sheets (not translated).

Version 4 now features a translation sheet covering names in Danish,
Dutch, German, Spanish, Finnish, French, Italian, Japanese, Norwegian,
Portuguese, Portuguese (Brazil), Russian and Swedish. Separate sorting
by language and Help buttons to directly access the Help files.

More translators required. Just email and ask. No requests on
newsgroups please.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes."
 
R

roandr

Again, thanks alot!

I'll just install my english copy and take it from there...

What does "There are translations available to -good homes-" actuall
mean
 
F

Frank Kabel

Hi
just ask Norman by mail to send them to you - If done in a nicely
manner I'm quite sure you will receive them instantly :)
 
P

Peo Sjoblom

If your home is not good you won't get a copy,
since one of Norman's specialties is real estate appraisal
it might mean the quality of your house and since you are Norwegian
and I assume they are similar to Swedish houses I don't think that is a
problem<g>
Here's a link

http://contextures.com/functions.html

Don't know how updated they are, for latest just
email him..
 
N

Norman Harker

Hi "roandr"!

Re: What does "There are translations available to -good homes-"
actually mean?

It's a pet project of mine. You don't give pets away unless they are
going to good homes!

Debra has just updated her site to include Version 4 with translations
plus updated Document version. I think that the download facility on
Debra's site has a "good homes" check. <vbg>

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
R

roandr

I havent tested it extensively but it seems to work like I want it to.

For those interested;

=IF(WEEKDAY(A2,2)<6,(B2<TIME(18,0,0))*(MIN(C2,TIME(18,0,0))-B2)*24*H2+(B2<TIME(21,0,0))*(C2>TIME(18,0,0))*(MIN(C2,TIME(21,0,0))-TIME(18,0,0))*24*H3+(C2>TIME(21,0,0))*(C2-MAX(TIME(21,0,0),B2))*24*H4+MAX(C2-B2-TIME(8,0,0),0)*24*73,IF(WEEKDAY(A2,2)=7,(C2-B2)*24*H7+MAX(C2-B2-TIME(8,0,0),0)*24*31,(B2<TIME(13,0,0))*(MIN(C2,TIME(13,0,0))-B2)*24*H2+(B2<TIME(16,0,0))*(C2>TIME(13,0,0))*(MIN(C2,TIME(16,0,0))-TIME(13,0,0))*24*H5+(C2>TIME(16,0,0))*(C2-MAX(TIME(16,0,0),B2))*24*H5+MAX(C2-B2-TIME(8,0,0),0)*24*31))

Note: Column I refers to the hour's pay tariff. A2 is the date, B2 i
the start time and C2 is the end time.

Another question: Is it possible to make this formula shorter
 
F

Frank Kabel

Hi
you may try substituting the TIME(...) parts with the respective value.
That is TIME(16,0,0) = 0.75, etc.
but this will not shorten the formula that much. The only other way
would be to create a user defined function for this task
 
R

roandr

Hm, I doesnt show up as a new reply if I edit my post. Well, I've don
it a couple of times so... ttt

Your too quick Frank Kabel ;
 
N

Norman Harker

Hi roandr!

You'll need to make those references to the pay rates absolute if
you're intending to copy down. I'd break up the formula into separate
cells (perhaps in hidden columns); it will make understanding and
editing easier in future. Also I think a VBA function might be a
better solution.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

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