Assign Custom classes to every Excerpt

Firstly, there are syntax errors in your (last block of) code.

And secondly, you don’t need to add any specific class at all. Just use the post ID for each post:

<article id="post-<?php the_ID(); ?>">
    <div class="post-content">
        <?php if ('excerpt' === $gantry->get('blog-content', 'content')) : ?>
            <div class="excerpt">
                <?php the_excerpt(); ?>
            </div>
        <?php else : ?>
            <?php the_content(false); ?>
        <?php endif; ?>
    </div>
</article>

Then you can target your excerpts like so:

#post-23 .excerpt {
    /* styles for excertp of post 23 */
}

#post-42 .excerpt {
    /* styles for excertp of post 42 */
}

But, why would you want to individually target each and every excerpt in the first place?

This is unfeasible for a large number of posts.
And your website might look a little chaotic, too.