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?
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,465
Office Version
  1. 365
Platform
  1. Windows
Hi, something like this maybe.

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

andrewvanmarle

New Member
Joined
Aug 11, 2015
Messages
40
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);"")
 

andrewvanmarle

New Member
Joined
Aug 11, 2015
Messages
40
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?
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,465
Office Version
  1. 365
Platform
  1. Windows
"" 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);""))
 

andrewvanmarle

New Member
Joined
Aug 11, 2015
Messages
40
Ah, well fixed it by addding a zero to the last ""

that gives a date, but so far in the past that it isnt relevant.

TY!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,977
Messages
5,599,151
Members
414,292
Latest member
kingshuk963

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
Top