Can I configure a calculated column in my document library to take the name of the folder where a document is uploaded to? if yes how? for e.g If there is a folder called 'HR' I want the value 'HR' to be present in that column
We could not get the current list/library name using the calculated column, as the calculated column do calculations based on other columns.
As a workaround, you can use the workflow to achieve it.
But you should have a static length of folder names, and use the Extract Substring from End of String action.
If you choose to go this route you can set it to use the “Path” of the current item and count backwards the number of letters in the name of the folder.
If you don’t want to have static lengths for folder names you’ll have to build a custom action that will all you to extract the substring after a letter or symbol.