Excel: Subtract Cell Based Text Another Cell
This article explains how to subtract the text of one cell from another cell based on a label in Excel.
Assumption
Assume you have the following data:
DepartmentA: 100, 200DepartmentA: 100, 200DepartmentB: 300, 400DepartmentB: 300, 400DepartmentC: 500, 600DepartmentC: 500, 600
Formula
In an empty cell, let's say cell D2, input the following formula:
=IF(B2=A2,0,IF(LEFT(A2,1)=B2,RIGHT(B2,LEN(B2)-LEN(LEFT(A2,1))-1),""))
Copy this formula to the rest of the cells in column D.
Result
Now, the cell D2 will show the difference between the Budget for label "B" and label "A" for department A. Similarly, cell D3 will show the difference between the Budget for label "B" and label "A" for department B, and so on.