I need a formula that will satisfy this logic statement: If D2 = 1, subtract B3 from B2 and multiply the results by 1440. If D2 does not = 1, enter XXX. The answer goes in E2.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]DATE[/TD]
[TD]TIME[/TD]
[TD]GUARD[/TD]
[TD]BUILDING[/TD]
[TD]TIME[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]07/02/18[/TD]
[TD]6:28:00[/TD]
[TD]321[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]07/02/18[/TD]
[TD]7:35:00[/TD]
[TD]333[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]DATE[/TD]
[TD]TIME[/TD]
[TD]GUARD[/TD]
[TD]BUILDING[/TD]
[TD]TIME[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]07/02/18[/TD]
[TD]6:28:00[/TD]
[TD]321[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]07/02/18[/TD]
[TD]7:35:00[/TD]
[TD]333[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]