# If function date problem

Closed
zombie_hunter - Feb 2, 2015 at 11:49 AM
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 - Feb 2, 2015 at 12:54 PM
Hello,
i am trying to use excel to give me two values depepnding if its a monday or a wednesday

i have a date box so every week a person will put the current date in the box
they will only use the spreed sheet on a monday or a wednesday so i only need the funtion to work for those two days
when it is a monday i want it to give them a set figure minus a figure they enter
if it a wednesday i want it to give them a different figure

examples below

If(b3=monday,[F3-C3],[G3-C3])
B3 = date cell
F3 = set figure for monday
C3 = entered figure
G3 = set number for thursday

so if F3 = 4 and its monday and they enter 2 into cell C3 then the figure it gives them should be 2 so it totals 4 and if it thursday it should be 4 so it totals 6

really hope im making sense

thanks to any one who can help

## 2 replies

pijaku Posts 12263 Registration date Wednesday May 14, 2008 Status Moderator Last seen March 15, 2023 1
Feb 2, 2015 at 12:43 PM
Hello,

Try the WEEKDAY function. I don't know with an English Excel but with a French one : WEEKDAY(Date Cell) = 2 If date cell is a monday

So you can try a formula like :

=IF(WEEKDAY(B3)=2,F3-C3,IF(WEEKDAY(B3)=4,G3-C3,"not monday or wednesday"))
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 26
Feb 2, 2015 at 12:54 PM
Note sure which day you are using, Wednesday or Thursday?
Anyway you can use the WEEKDAY function to return the day number:

=IF(WEEKDAY(B3)=2,F3-C3,IF(WEEKDAY(B3)=5,G3-C3,"") )

Where WEEKDAY returns one of the following:
Sunday 1
Monday 2
Tuesday 3
Wednesday 4
Thursday 5
Friday 6
Saturday 7