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.

MS Excel Formula

Hi

I have been wrecking my brains to try and achieve this. I have a formula at present which does a calculation if a cell is not blank but I also want to cap the calculation even the calculation is greater than another cell.

=IF(S26 = "", "", (S26*Q26)) - (current formula)

any ideas?
progress.gif

OD £2,500 cleared onto Money Transfer

MT 0% 20 months Jan26 £1,550 / £2,575


No. #20 - Save 1p A Day 2026 £581.97 /  £667.95

No. #6 - Fiver Friday Challenge for 2026 £330 / £260 - COMPLETE 

Invested £360 into Vanguard FTSE all world

Comments

  • Cornucopia
    Cornucopia Posts: 16,833
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Forumite
    edited 1 August 2018 at 10:07AM
    You just need to stack your IF functions in the right way (usually in a sequence from first thing to do, to last thing to do).

    e.g.

    =IF(first test, IF(second test, result1, result2), result3)
  • Cornucopia wrote: »
    You just need to stack your IF functions in the right way (usually in a sequence from first thing to do, to last thing to do).



    IF(S26 = "", "", (S26*Q26) IF T26 > J26 = J26)


    didn't work!!

    progress.gif

    OD £2,500 cleared onto Money Transfer

    MT 0% 20 months Jan26 £1,550 / £2,575


    No. #20 - Save 1p A Day 2026 £581.97 /  £667.95

    No. #6 - Fiver Friday Challenge for 2026 £330 / £260 - COMPLETE 

    Invested £360 into Vanguard FTSE all world
  • Cornucopia
    Cornucopia Posts: 16,833
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Forumite
    IF(S26 = "", "", (S26*Q26) IF T26 > J26 = J26)


    didn't work!!
    They need stacking. e.g.

    =IF(S26="","",IF(T26>J26,S26*Q26,J26))

    (assuming I've understood what you wanted).



    Why is this appearing in your posts?
    progress.gif

    I quite like it. I might borrow it for posts I haven't finished editing. :)
  • not working - error message


    =IF(S26="","",IF(S26*Q26,T26>J26,J26))



    PPyAAAAABJRU5ErkJggg==

    OD £2,500 cleared onto Money Transfer

    MT 0% 20 months Jan26 £1,550 / £2,575


    No. #20 - Save 1p A Day 2026 £581.97 /  £667.95

    No. #6 - Fiver Friday Challenge for 2026 £330 / £260 - COMPLETE 

    Invested £360 into Vanguard FTSE all world
  • Cornucopia
    Cornucopia Posts: 16,833
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Forumite
    edited 1 August 2018 at 11:42AM
    The first part after each "IF(" has to be a test, and the second and third parts are results.

    So, you can't have "S26*Q26" as a test, and although you can have "T26>J26" as a result, it probably doesn't make sense in this context. (And it's not what I posted).

    What is it that you are trying to do?

    =IF(S26="","", [if S26 is blank, return a blank]

    otherwise

    IF(T26>J26,S26*Q26, [if T26>J26, return S26*Q26]

    otherwise

    J26)) [return J26]
  • In English?
  • Not clear what OP is trying to achieve but if say
    Q26=2, R26=9, S26=4 where R26 is the capped value
    then the formula =IF(S26="","",MIN(R26,S26*Q26)) in T26
    will return 8 (=product Q26*S26 since this is less than capped value)
    but if R26=6 say then formula evaluates as 6.
  • Cornucopia
    Cornucopia Posts: 16,833
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Forumite
    In English?

    It was never going to be in English (the OP asked for an Excel formula). :)
  • Heedtheadvice
    Heedtheadvice Posts: 3,142
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    Sometime nested formulae such as that which you are trying to develop can be a bit confusing to understand until you break them down into their formula sections. The colour coding of parts helps.


    But why and try to make something that confuses? The is nothing wrong with keeping the formulas in separate cells. Do the first test in cell b (just as an example) -your first test and calculation- and your second test in the next column , say cell c.


    I do like waywards method of using the minimum function (neat simple easy to read) and suggest you find if a cell is truly blank by using the isblank() function rather rhan testing for an empty string "", if that is really what you wish to do! Explanation below:


    https://exceljet.net/excel-functions/excel-isblank-function
This discussion has been closed.
★ ★ ★ Meet your Ambassadors

Categories

  • All Categories
  • 356K Banking & Borrowing
  • 255K Reduce Debt & Boost Income
  • 456.3K Spending & Discounts
  • 248.5K Work, Benefits & Business
  • 606.3K Mortgages, Homes & Bills
  • 179.1K Life & Family
  • 264.1K Travel & Transport
  • 1.6M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.7K Read-Only Boards
Quick Search

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.