SOLVED

IF function

Copper Contributor

image.png

 

If the totalt amount of money spent on shopping is over the discount limit at 2000NOK, the discount must be automatically deducted from the total. How do i have to write the function?

4 Replies

@TrudeB 

 

=LET(s, SUM(D4:D6), rabatt, (s>=D10)*D11, s-rabatt)

 

=LET(s; SUMMER(D4:D6); rabatt; (s>=D10)*D11; s-rabatt)

What do you think about this one?

"Hvis" = "If"

=HVIS((SUMMER(D4:D6))>=D10;SUMMER(D4:D6)+D11;SUMMER(D4:D6))
best response confirmed by TrudeB (Copper Contributor)
Solution

@TrudeB 

Shouldn't that be

 

=HVIS((SUMMER(D4:D6))>=D10;SUMMER(D4:D6)-D11;SUMMER(D4:D6))

 

Alternatively

 

=SUMMER(D4:D6)-HVIS(SUMMER(D4:D6)>=10;D11;0)

 

or

 

=SUMMER(D4:D6)-(SUMMER(D4:D6)>=D10)*D11

Ah, thank you Hans!
Yes, it should for sure be minus, not plus! I felt my function was way too long, so thank you for the alternatives they are great!
1 best response

Accepted Solutions
best response confirmed by TrudeB (Copper Contributor)
Solution

@TrudeB 

Shouldn't that be

 

=HVIS((SUMMER(D4:D6))>=D10;SUMMER(D4:D6)-D11;SUMMER(D4:D6))

 

Alternatively

 

=SUMMER(D4:D6)-HVIS(SUMMER(D4:D6)>=10;D11;0)

 

or

 

=SUMMER(D4:D6)-(SUMMER(D4:D6)>=D10)*D11

View solution in original post