Nested IF for phone tariffs with free minutes/texts?

newbie188

New Member
Joined
Feb 16, 2021
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
Hi,

trying to write a formula to calculate phone bills based on different mobile phone tariffs with free minutes and texts. The first part of the formula is ok, i.e. add monthly tariff to (number of texts times cost of texts), etc., but some tariffs have free texts and minutes, so not all usage is chargeable. how do i only multiply the usage above the threshold? see attached.

current formula (which ignores thresholds/free minutes/texts) =IF(C7="A",(($E$2*D7+$F$2*E7+$B$2)/100),IF(C7="B",(($E$3*D7+$F$3*E7+$B$3)/100),IF(C7="C",(($E$4*D7+$F$4*E7+$B$4)/100))))

(sorry, couldn't upload mini Excel sheet0

thanks!
 

Attachments

  • tariffs.jpg
    tariffs.jpg
    83.3 KB · Views: 7

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

StephenCrump

MrExcel MVP
Joined
Sep 18, 2013
Messages
4,996
Office Version
  1. 365
Platform
  1. Windows
Here's one way:

ABCDEF
1TariffChargeFree minsFree textsCall costText cost
2A0002415
3B101501252817
4C25250unlimited300
5
6ExamplesMinsTextsCost
7C99420.00
8A110.39
9B16012.80
10C2601003.00
Sheet1
Cell Formulas
RangeFormula
E7:E10E7=INDEX((C7-IF(C7<C$2:C$4,C7,C$2:C$4))*E$2:E$4+(D7-IF(D7<D$2:D$4,D7,D$2:D$4))*F$2:F$4,MATCH(B7,A$2:A$4,))/100
 

Forum statistics

Threads
1,176,276
Messages
5,902,294
Members
434,959
Latest member
etb1025

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
Top