|First, a posting tip:|
When posting in a Help forum such as this one, please try to use a Subject Line that tells us something about your question. If everyone used a generic Subject Line such as "I Need A Formula" we wouldn't be able to tell one question from another and the Archives would essentially be useless.
I have edited your subject to be more relevant to your question.
As for your question, I'm not sure how we are supposed to determine the value you want in Column B for each "Yes" in Column A. Your example shows B5 = 5. Is that because of the Row number 5? If so, then put this in B1 and drag it down:
The ROW() function will return the Row number of whatever row it is in. To see this, enter =ROW() in any cell. There is also a COLUMN() function to return a column number.
If that is not what you are looking for, please explain how the value for Column B is determined.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.