Here's one option

=A1*4%-MIN(300000,A1)*(4%-3%)-MIN(100000,A1)*(3%-2%)

where Sales amount is in A1