How to create a formula based on if function

Occasional Contributor

I am trying to create a formula that is essentially (based on dummy data below):

 

(in cell c2) - if A2 is equal to A3, subtract b3 from b2. 

 

Is this even possible?!

 

1ABC
2Joe Bloggs100 
3Joe Bloggs95 
4John Doe300 
5John Doe200 
6John Doe200 

 

1 Reply

@LL19911695 

In C2:

=IF(A2=A3,B2-B3,"")

Fill down.