Newbe with formula problem

FotoJohan

New member
Joined
Oct 19, 2016
Messages
2
Reaction score
0
Points
0
I started to make formulas, trying to learn some same time I put it to use in my work.

I am working on a small formula that vill calculate number of photos my clients sent to me and if it is more then my standard packages allow. So far so good, it works fine... well almost I have 1 small issue with it, if the clients sent fewer photos than a package have as max, it will showing a result that is negative, that means less then the package size. I need the formula to change negative result to 0 and I cant figure it out...

=IF(C7="Lägenhet";E7-$L$7;IF(C7="Villa";E7-$L$8;IF(C7="5-Bilders";E7-$L$9;$L$12)))

This is the cell set up:

C7 in this case it a list meny of different packages
E7 is the number of photos my clients sent to me I type it manual for each line
$L$7, $L$8, $L$9 is a seperate small table where I ad different packages, and the corresponding number of max photos.
$L$12 is just 0 representation as long as there is no listing.

When you pick a package, the formula looks at the corresponding number of allowed photos, if its more then max, it ads this in the list and automatic calculate extra charges. Now my problem is if a client send less photos, I get a negative result that actualy deduct money from the package and we have 1 price for the package, no deduction so it the value would become negative I need it to be transformed to 0

I have been looking at setting something like IF(NOT( but I have no idea how to do it... as I say, I am brand new to this and realy need your help with this...

Sincerely
Newbie Johan
 
I think attaching a sample workbook would make things easier for us.
 
IF you want 0 instead of negative result, you can wrap your function or entire formula with a MAX()

eg.

=MAX(0,IF(C7="Lägenhet";E7-$L$7;IF(C7="Villa";E7-$L$8;IF(C7="5-Bilders";E7-$L$9;$L$12))))

so that if the result of the IF() part is negative, then the maximum of 0 and that negative will be 0. If the result of the IF() is positive, then the maximum of 0 and that result will be that positive result.
 
IF you want 0 instead of negative result, you can wrap your function or entire formula with a MAX()

eg.

=MAX(0,IF(C7="Lägenhet";E7-$L$7;IF(C7="Villa";E7-$L$8;IF(C7="5-Bilders";E7-$L$9;$L$12))))

so that if the result of the IF() part is negative, then the maximum of 0 and that negative will be 0. If the result of the IF() is positive, then the maximum of 0 and that result will be that positive result.

Thank you so much, that works perfect! :) I just learn some thing new... whoo... :)
 
Back
Top