Moving all .xlsx files from the last five days (but not today)
First, if you are using Python 3, you can use pathlib to make your life regarding paths a lot easier (especially if you want your scripts to work on both Windows and Linux). If you are not using Python 3 by now, well, you should.

While your approach works (and could be made a bit shorter maybe using a complex RegEx), you might want to look into different methods of doing this. Instead of manually using the format of your file names, you can use the time the file was last modified (or accessed) and just filter on that:

from datetime import datetime, timedelta
from pathlib import Path
import shutil
from typing import Iterable

def old_files(dir: Path, pattern: str, start: int = -5, end: int = -1) -&gt; Iterable[Path]:
    """List all files in `dir` matching `pattern` modified between
    `start` and `end` (both inclusive) days from today.
    """
    today = datetime.today()
    start = (today.replace(hour=0, minute=0, second=0, microsecond=0)
             + timedelta(days=start)).timestamp()
    end = (today.replace(hour=23, minute=59, second=59, microsecond=999999)
           + timedelta(days=end)).timestamp()
    return (file for file in dir.glob(pattern)
            if file.is_file() and start &lt;= file.stat().st_mtime &lt;= end)


Which you can use like this:

if __name__ == "__main__":
    dir = Path(r"C:\Users\GuilhermeMachado\Documents\Carteiras")
    new_dir = dir / "Historico/"
    new_dir.mkdir(exist_ok=True)
    for file in old_files(dir, "*.xlsx", start=-5, end=-1)
        shutil.move(str(file), new_dir)


Note that I used the fact that when you divide a path by a string (`dir / "Historico") it just joins the path (with the correct path separator depending on your OS).

I also added a if __name__ == "__main__": guard to allow importing from this script without the code running, made the number of days to select parameters of a function to which I also added typing hints and a docstring and followed Python's official style-guide, PEP8, by having spaces around the = for assignments.

Of course this assumes that you have no other Excel spreadsheets modified during the last five days in that folder. In that case you might be able to adapt the pattern to only match the files you want, or you will have to use a different method for filtering the files. But that would just mean modifying the function, not your whole script. This way the changes are localized, which makes it easier to track.