If "value" can bedivided by 5 then....

andrewvanmarle

New Member
Joined
Aug 11, 2015
Messages
40
Hi All,

I have a list of national holdays and the current year in A1

This is the formula for the date:
Excel Formula:
=DATUM(A1;5;5)

And it works, but......

We wouldnt be dutch if we didnt make things complicated:

This is only a holiday every fith year.


So i'm looking for something that goes IF a1 is divisible by 5 then show the above date else NULL

What would that formula look like?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi, something like this maybe.

=IF(MOD(A1;5)=0;DATUM(A1;5;5);"")
 
Upvote 0
Solution
Super!!

the dutch bversion looks like this by the way (for the dutchies on the forum)

Excel Formula:
=ALS(REST(A1;5)=0;DATUM(A1;5;5);"")
 
Upvote 0
Hmmmm I have a new conundrum:

Im using this code to calculate workdays with a list of holidays (the H-range) to be counted as non work day.
Excel Formula:
=ALS(OF(A5="";B5="");"";NETWERKDAGEN.INTL(A5;B5;2;$H$3:$H$17))

When the above code comes up with a date it works fine, but when it comes up with Null, the code gives a invalid value warning.

"" isnt the same as an empty cell?
 
Upvote 0
"" isnt the same as an empty cell?

Hi, no - a formula can't return "nothing" but you could check what the second formula returned and do something different when it returns "".

For example:

Excel Formula:
=ALS(A1="";"";IF(REST(A1;5)=0;DATUM(A1;5;5);""))
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top