Subtracting cells

Asquare

New Member
Joined
Aug 23, 2016
Messages
19
I want to subtract cell D3 from cell D2 but only if cells B3 & B2 have the same value. if cells B3 & B2 are not equal, I want the formula to detect the next two cells that contain the same values and subsequently deduct their respective values in column D. In this case the values in cells B5 & B4 are not equal, hence the formula should check cells B5 & B6 and if they contain the same value deduct the values in cell D6 & D5 (D6 - D5).

Thank you in advance.


Column B Month Column D Value
90001-Jul-1581408140
90001-Aug-15149996859
90001-Sep-1520978
90101-Jul-159000
90101-Aug-1514633
90101-Sep-1519715
90201-Jul-158338
90201-Aug-1512799
90201-Sep-1517059
90301-Jul-158913
90301-Aug-1513960
90301-Sep-1518475

<tbody>
</tbody><colgroup><col><col><col><col></colgroup>



<tbody>
</tbody><colgroup><col><col><col><col></colgroup>



<tbody>
</tbody><colgroup><col><col><col><col></colgroup>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,581
Messages
6,125,656
Members
449,246
Latest member
jbbtz28

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top