Google’s John Mueller said on Twitter that Google does not index parts of a page independently. They index full pages and then they try to understand the context of the content:
We don't index parts of a page independently, we index the pages as a whole, and try to understand the context of the content there. Scrolling to a part of a page when we know that's where the snippet was from makes a lot of sense regardless of indexing.
— ? John ? (@JohnMu) August 7, 2019
Make sure that Google can index all of your pages
The website audit tool in SEOprofiler helps you to make sure that Google can index all of your web pages: