IF Based on result of a SUMIF (built into formula)

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
221
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am trying to create a formula which will do a SUMIF but then provide a different result if the answer is less than needed (without creating another cell)

Q12 = =SUMIF($L$12:$L$17,P12,M12:M17)

However, as an Example I would like Q12 to return a result of 20 if the actual result is 20...

R12 = =IF(Q12<20,20,Q12)

I can do this easily by creating another cell and applying an if statement. But can I this built into Q12 formula so I do not need to create a new cell?


Excel 06.11.2020.PNG
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
garypea123, Good morning.

This formula works for you?

Q12 --> =MAX( SUMIF($L$12:$L$17,P12,M12:M17), 20)

I hope it helps.

Have a nice day.

Greetings from Brazil.
 
Upvote 0
Great, Greetings Brazil, from UK
This works for sure if I am going to return a specific number value....

However, if I would like to actually apply another fomula instead of a number.

I have updated an example below:

I would like Q12 to create a SUMIF from Table 1, however, of the result is less than 20 then I would like the it too look at Table 2 (which should be more than 20 in theory).

R12 = =SUMIF($L$12:$L$17,P12,M12:M17)
S12 = =SUMIF($L$12:$L$17,P12,N12:N17)

However, I would like to not have R12 and S12 in use, and the formula being driven purely by Q12.

Currently in Q12 I have manually put in what I would expect to see if the formula works :)


Excel 06.11.2020.PNG
 
Upvote 0
garypea123,

I believe that this formula works for your new necessity.

Q12 -->
Excel Formula:
=IF(SUMIF($L$12:$L$17,P12,$M$12:$M$17)<=20, SUMIF($L$12:$L$17,P12,$N$12:$N$17), SUMIF($L$12:$L$17,P12,$M$12:$M$17))

Since you didn't say what should happen when the sum value is = 20, I am assuming in the formula that it is <= 20.

Can you work with this new formula?

I hope it helps.
 
Upvote 0
Thats perfect, and even more it makes complete logical sense that I am surprised with myself for not being able to write that myself (maybe just a bad day).

But yes, its perfect and definitely helps me moving forward.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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