The reason this isn't working is that Excel doesn't understand 20170514 as a date - it sees this as a number instead.
Using a custom format code allows you to change the way Excel displays the date, but you will still need to enter the date in a format that Excel recognizes as a date. If you try entering 2017-05-14 or 14 May 2017, for example, Excel will recognize these as dates and then apply the custom formatting to display them as 20170514.
If you really need to enter the date in this format, you can work around this limitation by using the LEFT, RIGHT, MID and DATE functions.
You can see how to use LEFT, RIGHT and MID in the video lesson: Expert Skills Lesson 3-20 Extract text from fixed width strings using the LEFT, RIGHT and MID functions.
The DATE function is explained in the video tutorial: Expert Skills Lesson 3-11 Use the Excel DATE function to offset days, months and years.
I have attached an example workbook showing how you can convert the number 20170514 into a date serial number that Excel will understand and allow you to add days to:
If you're not familiar with the concept of date serial numbers, you can find an explanation in: Expert Skills Lesson 3-7 Understand Excel date serial numbers and custom date formats.
I hope this is the solution you need, but please feel free to reply again if you need any more help with this.
Jonathan is part of the professional team who answer Excel-related questions posted on the ExcelCentral.com forums.
Jonathan also tests our courses prior to publication and has worked on all of our ten world bestselling Excel books for Excel 2007, Excel 2010, Excel 2013, Excel 2016 for Windows and Excel 2016 for Apple Mac. Jonathan has also worked on over 850 video lessons for or video courses covering Excel 2007, Excel 2010 and Excel 2013.
As well as extensive Excel knowledge, Jonathan has worked in the IT world for over thirteen years as a programmer, database designer and analyst for some of the world's largest companies.