I am having this same problem with my Inspiron 5558. It is not the adapter or the battery (still holds a good charge when I CAN make it work)
If I repeatedly unplug the adapter from the laptop and plug it back in, it eventually will charge normally. At first, this would take a couple of tries, maybe up to 5 or 6. Now, it takes many, many attempts, over a hundred on one occasion.
I have reloaded BIOS and driver. It is definitely a software issue, because when it is in "plugged in, not charging" state, it also runs slow and stuttering. Video is jumpy and audio crackles, even when playing a file directly from the hard drive.
Is this firmware of some kind? I have seen a lot of mentions of this kind of problem online, so it has to be something standard with the Dell package. Dell support suggested I buy an $82 battery from them. Baloney.