Forum

Notifications
Clear all

Need help with Excel formulas

3 Posts
3 Users
0 Reactions
71 Views
(@charli07)
Posts: 1
New Member
Topic starter
 

Can someone help me write a formula for cell D2 for the following scenario?
I need to workout the sum of b2 to c2 in d2 if how ever the value in c2 is => than b2 return 0.

So

B2 is 3 and C2 is 2. D2 = 1

B2 is 3 and C2 is 3. D2 = 0

B2 is 3 and C2 is 5. D2 =0

 
Posted : 27/01/2023 10:55 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Charli,

You say you want to work out the sum of B2 and C2 but in your first example, the result you give is the difference?

To use the sum as the result, try this in D2

=IF(C2>=B2,0,B2+C2)

If you want the difference (B2 - C2) use this

=IF(C2>=B2,0,B2-C2)

Regards

Phil

 
Posted : 27/01/2023 5:30 pm
(@debaser)
Posts: 836
Member Moderator
 

For the difference, you could also use:

=MAX(0,B2-C2)

 
Posted : 28/01/2023 5:15 am
Share: