We've designed Sprout SEO to help you handle situations like these. Personally, I think it's the easiest path to take for dealing with this situation. So, my first answer would be to consider using it.
There is an example on how to assign meta values in included Matrix blocks in the Sprout SEO docs here Extending a Base Layout
But, this is a question on StackExchange so that answer alone is unsatisfying. If you'd like to dig into solving this issue yourself, to start, I'd recommend you try to get the best understanding you can of the Twig Processing Order. While part of the challenge your facing is how to grab the specific text you need from the field variable (Bill Chriswell's answer addresses that), another part of it may be where your variable exists in your templates.
For example, if you are managing your variables in a parent _layout
template and trying to assign your excerpt within a block tag extending it, you're description variable is getting set after you are outputting your meta variables.
So, however you are assigning your meta variables you need to make sure that you are assigning the description variable in a way that it gets updated before you are actually outputting the meta values in your header.
I'll quote a couple paragraphs from the Twig Processing Order article linked above:
[T]he Twig processing order flows down the page. Variables are processed and become available farther down the page to be output.
Sometimes however, we can only determine a value farther down the
page, and the value itself needs to be output higher on the page.
Out of the box, some scenarios like this can be handled by Twig but things can get messy quick, and code that once felt dry can begin to
feel harder to maintain. Other scenarios simply can't be solved
without extending Twig or managing your variable with the help of a
plugin.
Here are three methods mentioned in the article to consider if you want to get around this:
- Try to set your variables as high on the page as you can. Even
arrays of data can be queried and set as variables higher on the
page. Once a variable exists, it's much easier to refer to that
variable anywhere below it's first instance in your templates.
- Create your page variables in a plugin. Craft allows you to set up
routes to point to a Controller action instead of a page template.
- Consider building a plugin and and managing the variable of the
content you need access to in a Twig Global or public variable in
the service layer of your plugin.