简体   繁体   中英

Sum column according to another in excel

I have for each line i have 2 columns:

  • Column localisation: #/CITY/BUILDING/FLOOR/ROOM
  • Column time spent: HH:MM

I need to extract for each #/CITY/BUILDING/FLOOR the sum of time spent

#/MAIN/063/00/024.  00:30
#/MAIN/059/00/024   04:00
#/MAIN/059/00/022.  01:30
#/MAIN/027/01/022.  01:00

So, i need to sum all time for each building floor in my example:

#/MAIN/063/00  00:30
#/MAIN/027/01. 01:00
#/MAIN/059/00. 05:30

It's quite possible with Microsoft365's dynamic arrays:

在此处输入图像描述

Formula in D1 :

=CHOOSE({1,2},UNIQUE(LEFT(A1:A4,13)),SUMIF(A1:A4,UNIQUE(LEFT(A1:A4,13))&"*",B1:B4))

Note that column in is a custom number-format: [HH]:MM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM