Forum Discussion

Livinsc05's avatar
Livinsc05
Copper Contributor
Sep 20, 2020

Excel calculation

Hi. I have a spreadsheet. Top row is a list of dance classes which have varying costs. The first column is a list of pupils. Is there an easy way to calculate the costs for each pupil depending on which class columns are ticked/selected?
Thanks

3 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Livinsc05 You'll find three of many possible variants in the attached workbook. One using MMULT with 1's for "class taken" and 0's for "class not taken". The second uses SUMPRODUCT and accepts blanks in case a class is not taken by a pupil. A third variant uses a more traditional SUMIF, and allows you to put any character/word in the matrix to indicate "class taken", as long as you use the same character/word as the criteria in the formula.

     

  • SMB-2020's avatar
    SMB-2020
    Copper Contributor

    Livinsc05 Assuming you have the cost of each class above the column heading for each class and that the cost is on line 26 and the class name is on line 27 and your first name is on line 28 and the name column begins on column LI, you can use this formula, if there are more than 3 classes, just extend the formula.  =IF(LK28<>"",$LK$26,0)+IF(LL28<>"",$LL$26,0)+IF(LM28<>"",$LM$26,0)

     

    So on my spreadsheet, the first name appears on LI28, the Cost is in LJ28 (where the above formula is added) the first class cost is on line LK26 class name is on LK27 and you can add anything into LK28 to indicate they have this class, if they don't leave it blank (empty).  You can copy it to as many lines as you want and if the price of the class changes, you just change it above the class name and it will repopulate the entire spreadsheet.  If you don't want the first 20 lines or students to have their data changed, just copy their information and past it as values. Then they are permeant.

     

    Hope this helps. others may have an even better way to do this.  good luck

     

Resources