Day Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,

I am working on a worksheet, and I have a little problem, it is not that
important, but it is part of the worksheet. I am using the function
WEEKDAY(C8,1). If I put this date: 8/1/2006 in cell C8, it returns "3", which
is correct so far. However, when I integrate the function WEEKDAY() in the
function IF() (see below):

=IF(WEEKDAY(C8,1)="1","Zondag",IF(WEEKDAY(C8,1)="2","Maandag",IF(WEEKDAY(C8,1)="3","Dinsdag",IF(WEEKDAY(C8,1)="4","Woensdag",IF(WEEKDAY(C8,1)="5","Donderdag",IF(WEEKDAY(C8,1)="6","Vrijdag",IF(WEEKDAY(C8,1)="6","Zaterdag","")))))))

Language=Dutch for the days, sorry about that:)

So the problem is, when I use this formula, it returns the last
VALUE_IF_FALSE, which is "", that gives me an empty cell. It is only supposed
to give an empty cell if all the previous statements are False, and that is
not supposed to be the case here.
If I put 8/1/2006 in cell C8, I want to see "Dinsdag". Sorry for my
incoherent story, hope you understand my problem!
 
Just use

=TEXT(C8,"dddd")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
You're formula will work if you remove the quotes from the "1", "2" etc,

=IF(WEEKDAY(C8,1)=1,"Zondag",IF(WEEKDAY(C8,1)=2,"Maandag",IF(WEEKDAY(C8,1)=3,"Dinsdag",IF(WEEKDAY(C8,1)=4,"Woensdag",IF(WEEKDAY(C8,1)=5,"Donderdag",IF(WEEKDAY(C8,1)=6,"Vrijdag",IF(WEEKDAY(C8,1)=7,"Zaterdag","")))))))

Another way avoiding all those 'IF's,

=CHOOSE(WEEKDAY(C8,1),"Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zatwerdag")

Regards,
Alan.
 
Thank you so much Alan,

Didn't know there was such an easy array function in Excel!

Great to know!

Thanks!
 
There is an easier one, see my response.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
You're right of course, but I assumed (rightly or wrongly) that the English
version was being used and the requirement was to display the days in Dutch.
On the Dutch version, the TEXT function would be be the simplest and
easiest,
Regards,
Alan.
 
Unfortunately Alan, neither is perfect in an international setting. Yours
has the days hard-coded (even assuming the OP can translate the functions),
and mine has the day identifier hard-coded. It is "dddd" in English, In
Dutch it would be "tttt" I presume, so it is hard-coded just the same.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Back
Top