Cap a value

Alenz

New Member
Joined
Nov 20, 2016
Messages
10
I have an IF that is working fine but I need to add that if the value is greater than 117, it should just state 117.

This is the part that works:
=IF(A9<>"",BO9-BR9-BS9-BQ9,"")

Now I need to add that if the answer to the above is greater than 117, it should give 117. But if it is less than 117, it should give the calculated value (BO9-BR9-BS9-BQ9).

Help please??
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
An alternative:
Code:
=IF(A9<>"",MIN(117,BO9-BR9-BS9-BQ9),"")

Hi ChrisGT7

Thanks for this! Seems to work fine except I need it to also just state 0 or preferably noting if A9 does not contain a value.
Currently it gives the correct answer when A9 has a value but then also gives 117 when A9 does not have any value.

Can you help?
 
Upvote 0
Is A9 totally empty? If it contains a space, then it is not empty and it should return 117 according to MIN().

To avoid checking for spaces in A9, try this one: =IF(LEN(TRIM(A9))>0,MIN(117,BO9-BR9-BS9-BQ9),"")
 
Upvote 0
Is A9 totally empty? If it contains a space, then it is not empty and it should return 117 according to MIN().

To avoid checking for spaces in A9, try this one: =IF(LEN(TRIM(A9))>0,MIN(117,BO9-BR9-BS9-BQ9),"")


Yay! My hero!

There wasn't a space in A9 but there was a formula though. Thanks for your help! :)
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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