You can easily achieve **Fee Calculation** on a **Monthly** basis and also on a **Daily** basis using only **Calculations & Logic Block **in Clappia. You can select only 1 month or more than 1 month. Here's how:

**1. Fee Calculation on a Monthly basis**

Consider a simple app as shown below which includes the particulars of the student, months, fee per month and the total fees.

Blocks used in the app:

Single Line Text - **Student Name.**

Single Line Text - **Roll Number.**

Single Selector - **Is it a Leap Year? **(Options: Yes, No.)

Multiple Selector - **Fee to be paid for the month/months?** (Options: All the months in the year.)

Single Selector - **Number of months.**

Calculations & Logic - **Number of days in the months selected** (This is where the magic happens. The Formula is explained below the image. Keep reading.)

Single Line Text - **Fee per month. **(The app user will enter the number manually.)

Calculations & Logic - **Total Fees Payable.** (Formula: Multiplication of "* Number of days in the months selected*" and "

*". Type @ and select the appropriate variables.)*

**Fee per month****Number of days in the months selected - **The below formula will automatically input the number of days in a month selected or the total number of days in the months selected.

If the answer is '**Yes**' for the leap year then **February will have 29 days**. If the answer is '**No**' then **February will have 28 days**.

**Formula: **The variable for the 'Number of days in the months selected' in this app is @multiple_s. **Replace this variable with the variable from your app**.

IF(SEARCH("January",{multiple_s})>0,31,0)+ IF(SEARCH("February",{multiple_s})>0,IF({is_leap_ye}="Yes",29,28),0)+ IF(SEARCH("March",{multiple_s})>0,31,0)+ IF(SEARCH("April",{multiple_s})>0,30,0)+ IF(SEARCH("May",{multiple_s})>0,31,0)+ IF(SEARCH("June",{multiple_s})>0,30,0)+ IF(SEARCH("July",{multiple_s})>0,31,0)+ IF(SEARCH("August",{multiple_s})>0,31,0)+ IF(SEARCH("September",{multiple_s})>0,30,0)+ IF(SEARCH("October",{multiple_s})>0,31,0)+ IF(SEARCH("November",{multiple_s})>0,30,0)+ IF(SEARCH("December",{multiple_s})>0,31,0)

**The Total fees will be calculated on a per month basis.**

**2. Fee Calculation on a Daily basis**

The app layout is same. You just have to edit **Fee per month** to **Fee per day** and add 2 more blocks to it:

Single Line Text block - **Number of days to exclude.**

Calculations & Logic block - **Applicable Days. **(Formula: The following Subtraction will happen - "* Number of days in the month/months?*" - "

*" . Type @ and select the appropriate variables)*

**Number of days to exclude**Total Fees Payable will now be - Formula: Multiplication of "* Applicable Days"* with "

*.*

**Fee per day"**

**The Total fees will be calculated on a per day basis.**