I will assume you are talking about contextual and formal analysis in art. In such a pair they are standing together only in this field. Contextual analysis is also used in a field of literature to analyze a vast variety of texts, but I’ll skip specification of it here.
So, contextual and formal analysis are both used in the art. There is a vast difference between them. Formal analysis is all about the artwork itself: the technique, the idea, the message author wanted to transfer, how the message is performed and shown to the audience, and so on. Main points of evaluation are things, like color, space, composition, line, etc.
The contextual analysis aims to reveal the impact of the artwork on the outside world: how it fits into the history of art, what’s the effect it creates, how it correlates with other artworks, and so on. It is more of a quantitative method.
I have also found some examples of how formal analysis is performed. Hope it would be helpful