Forum Discussion
CiliaJ1010
Nov 04, 2022Copper Contributor
SOM.ALS to refer to other cells as criterium
Hello everyone,
I have a problem with the SOM.ALS (SUMIF function in English) function. I have a very large file of numbers, this is a small part of it. If want to know the total amount of days a customer has stayed in a hotel. But some customers have stayed for multiple days (customer 1 has stayed 2 times, 30 days in total). How do I create a formule that I can add up the days in the hotel, dependent on the customer number.
If now use this: SOM.ALS(A2:A6900; "1"; F2:F6900), but then I have to manually chance the criterium each time.
Customer number | Days in Hotel |
1 | 1 |
1 | 29 |
2 | 3 |
3 | 1 |
3 | 2 |
4 | 3 |
5 | 5 |
5 | 9 |
6 | 3 |
6 | 1 |
6 | 0 |
8 | 5 |
9 | 1 |
10 | 2 |
10 | 9 |
10 | 9 |
10 | 2 |
10 | 1 |
10 | 1 |
CiliaJ1010 I would create a pivot table. See attached.
- Riny_van_EekelenPlatinum Contributor