We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Excel Help Please

molerat
molerat Posts: 35,652 Forumite
Part of the Furniture 10,000 Posts Name Dropper Photogenic
I have 2 formulae that I interchange as required. I would like to use one that covers both situations but can't figure out how to do it, everything I try gets rejected. Help please.

=IF((C2-G3-D14)>B18,B18,(C2-G3-D14))
=IF((C2-G3-D14)<0,0,(C2-G3-D14))

Comments

  • bod1467
    bod1467 Posts: 15,214 Forumite
    =IF((C2-G3-D14)>B18,B18,IF((C2-G3-D14)<0,0,(C2-G3-D14)))

    Try that.
  • molerat
    molerat Posts: 35,652 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Thanks, tested in all 3 situations and works ;)
  • Stompa
    Stompa Posts: 8,390 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    molerat wrote: »
    I have 2 formulae that I interchange as required. I would like to use one that covers both situations but can't figure out how to do it, everything I try gets rejected. Help please.

    =IF((C2-G3-D14)>B18,B18,(C2-G3-D14))
    =IF((C2-G3-D14)<0,0,(C2-G3-D14))

    Of course you could just use the somewhat simpler:

    =MIN(B18,C2-G3-D14)
    =MAX(0,C2-G3-D14)

    which could be combined as:

    =MAX(0,MIN(B18,C2-G3-D14))
    Stompa
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.2K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.