Welcome to the forum.
It's helpful if you could give specific examples of what you are asking. Like what cells have the values, and so on. However, here's one idea:
If the cells you are looking at are A1, A2 and A3, then the above formula might work for you. Let me know.