Adding together cell values if Duplicate value in another cell

cwills

New Member
Joined
Aug 6, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a sheet of data which is produced monthly, listing the start, finish and total time taken for a specific task. This is split into two rows of data as the task has 2 elements to it for completion.

What I need is for Column A to be checked and where there are duplicate values, the time in Column H to be added together and the duplicate row removed

Any help would be appreciated, I have tried to use the consolidate function but this isn't removing the duplicate rows correctly

Thank you

Analysis times.PNG
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
if you're ok with having a second table to consolidate the information this will work. This is also dependent on the table being sorted by sample reference values (column a).
i like doing things this way to keep my original data incase ever need to go back to it, instead of completely deleting it.
----------------------
Adding together cell values if Duplicate value in another cell.xlsx
ABCDEFGHIJKLMNOP
1sample refdateanalysis start timeanalysis end timeanalystresultclassificationcalc timetotal timesample refdatetotal timeanalystresultclassification
2a2/1/20226:06:526:19:20andreanotexture0:12:280:15:59a2/1/20220:15:59andreanotexture
3a2/1/20226:22:416:26:12andreanotexture0:03:31 b2/1/20220:14:25marianotexture
4b2/1/20226:12:436:23:33marianotexture0:10:500:14:25c2/1/20220:15:32andreanotexture
5b2/1/20226:23:406:27:15marianotexture0:03:35 d2/1/20220:15:04marianotexture
6c2/1/20226:26:176:33:58andreanotexture0:07:410:15:32e2/1/20220:15:07andreanotexture
7c2/1/20226:34:096:42:00andreanotexture0:07:51 f2/1/20220:14:57marianotexture
8d2/1/20226:27:486:34:53marianotexture0:07:050:15:04g2/1/20220:15:18andreanoinsulating
9d2/1/20226:35:406:43:39marianotexture0:07:59 h2/1/20220:15:02andreanotexture
10e2/1/20226:42:086:51:33andreanotexture0:09:250:15:07i2/1/20220:04:54andreachrysotiletexture
11e2/1/20226:51:356:57:17andreanotexture0:05:42 j2/1/20220:14:40marianotexture
12f2/1/20226:44:286:52:37marianotexture0:08:090:14:57
13f2/1/20226:53:187:00:06marianotexture0:06:48 
14g2/1/20226:58:207:07:24andreanoinsulating0:09:040:15:18
15g2/1/20227:07:287:13:42andreanoinsulating0:06:14 
16h2/1/20227:00:347:13:31andreanotexture0:12:570:15:02
17h2/1/20227:13:557:16:00marianotexture0:02:05 
18i2/1/20227:15:357:20:29andreachrysotiletexture0:04:540:04:54
19j2/1/20227:16:217:28:29marianotexture0:12:080:14:40
20j2/1/20227:28:597:31:31marianotexture0:02:32 
Sheet1
Cell Formulas
RangeFormula
H2:H20H2=D2-C2
I2:I20I2=IF(A2=A1,"",SUMIF(A:H,A:A,H:H))
L2:L11L2=VLOOKUP(K2,A:I,2,FALSE)
M2:M11M2=VLOOKUP(K2,A:I,9,FALSE)
N2:N11N2=VLOOKUP(K2,A:I,5,FALSE)
O2:O11O2=VLOOKUP(K2,A:I,6,FALSE)
P2:P11P2=VLOOKUP(K2,A:I,7,FALSE)
 
Upvote 0
Thank you ExcelLoki,

Quick question, how are you populating column K with the sample ref's excluding any duplicates?

Everything else works perfectly and will cut down a lot of my time going through this sheet each month.
 
Upvote 0
SO_CHI_TIET_BAN_HANG.xlsx
ABCDEFGHIJKLMNOP
1
2AM00529601-Feb06:0606:19blahblahblah00:12AM00529601-Febblahblahblah00:16
3AM00529601-Feb06:2206:26blahblahblah00:04AM00529701-Febblahblahblah00:11
4AM00529701-Feb06:1206:23blahblahblah00:11AM00529801-Febblahblahblah00:16
5AM00529801-Feb06:2306:27blahblahblah00:04AM00529901-Febblahblahblah00:04
6AM00529801-Feb06:0706:20blahblahblah00:12AM00530001-Febblahblahblah00:15
7AM00529901-Feb06:2306:27blahblahblah00:04AM00530101-Febblahblahblah00:12
8AM00530001-Feb06:1306:24blahblahblah00:11AM00530201-Febblahblahblah00:15
9AM00530001-Feb06:2406:28blahblahblah00:04AM00530301-Febblahblahblah00:04
10AM00530101-Feb06:0806:21blahblahblah00:12AM00530401-Febblahblahblah00:12
11AM00530201-Feb06:2406:28blahblahblah00:04AM00530501-Febblahblahblah00:15
12AM00530201-Feb06:1406:25blahblahblah00:11      
13AM00530301-Feb06:2506:29blahblahblah00:04      
14AM00530401-Feb06:0906:22blahblahblah00:12      
15AM00530501-Feb06:2506:29blahblahblah00:04      
16AM00530501-Feb06:1506:26blahblahblah00:11
Sheet1
Cell Formulas
RangeFormula
K2:K15K2=IFERROR(INDEX($A$2:$A$16,MATCH(0,INDEX(COUNTIF($K$1:K1,$A$2:$A$16),),0)),"")
L2:L15L2=IF($K2="","",VLOOKUP($K2,$A$2:$H$16,2,0))
M2:M15M2=IF($K2="","",VLOOKUP($K2,$A$2:$H$16,5,0))
N2:N15N2=IF($K2="","",VLOOKUP($K2,$A$2:$H$16,6,0))
O2:O15O2=IF($K2="","",VLOOKUP($K2,$A$2:$H$16,7,0))
P2:P15P2=IF($K2="","",SUMIF($A$2:$A$16,K2,$H$2:$H$16))
A2A2="AM00"&ROW(5296:5296)
A3,A12A3=A2
H2:H16H2=D2-C2
 
Upvote 0
Thank you ExcelLoki,

Quick question, how are you populating column K with the sample ref's excluding any duplicates?

Everything else works perfectly and will cut down a lot of my time going through this sheet each month.
i had just manually added them, but using what @bebo021999 put for that this should be good
------------------
Adding together cell values if Duplicate value in another cell.xlsx
ABCDEFGHIJKLMNOP
1sample refdateanalysis start timeanalysis end timeanalystresultclassificationcalc timetotal timesample refdatetotal timeanalystresultclassification
2a2/1/20226:06:526:19:20andreanotexture0:12:280:15:59a2/1/20220:15:59andreanotexture
3a2/1/20226:22:416:26:12andreanotexture0:03:31 b2/1/20220:14:25marianotexture
4b2/1/20226:12:436:23:33marianotexture0:10:500:14:25c2/1/20220:15:32andreanotexture
5b2/1/20226:23:406:27:15marianotexture0:03:35 d2/1/20220:15:04marianotexture
6c2/1/20226:26:176:33:58andreanotexture0:07:410:15:32e2/1/20220:15:07andreanotexture
7c2/1/20226:34:096:42:00andreanotexture0:07:51 f2/1/20220:14:57marianotexture
8d2/1/20226:27:486:34:53marianotexture0:07:050:15:04g2/1/20220:15:18andreanoinsulating
9d2/1/20226:35:406:43:39marianotexture0:07:59 h2/1/20220:15:02andreanotexture
10e2/1/20226:42:086:51:33andreanotexture0:09:250:15:07i2/1/20220:04:54andreachrysotiletexture
11e2/1/20226:51:356:57:17andreanotexture0:05:42 j2/1/20220:14:40marianotexture
12f2/1/20226:44:286:52:37marianotexture0:08:090:14:57      
13f2/1/20226:53:187:00:06marianotexture0:06:48       
14g2/1/20226:58:207:07:24andreanoinsulating0:09:040:15:18      
15g2/1/20227:07:287:13:42andreanoinsulating0:06:14       
16h2/1/20227:00:347:13:31andreanotexture0:12:570:15:02      
17h2/1/20227:13:557:16:00marianotexture0:02:05       
18i2/1/20227:15:357:20:29andreachrysotiletexture0:04:540:04:54      
19j2/1/20227:16:217:28:29marianotexture0:12:080:14:40      
20j2/1/20227:28:597:31:31marianotexture0:02:32       
Sheet1
Cell Formulas
RangeFormula
H2:H20H2=D2-C2
I2:I20I2=IF(A2=A1,"",SUMIF(A:H,A:A,H:H))
K2:K20K2=IFERROR(INDEX($A$2:$A$20,MATCH(0,INDEX(COUNTIF($K$1:K1,$A$2:$A$20),),0)),"")
L2:L20L2=IF(K2="","",VLOOKUP(K2,A:I,2,))
M2:M20M2=IF(K2="","",VLOOKUP(K2,A:I,9,FALSE))
N2:N20N2=IF(K2="","",VLOOKUP(K2,A:I,5,FALSE))
O2:O20O2=IF(K2="","",VLOOKUP(K2,A:I,6,FALSE))
P2:P20P2=IF(K2="","",VLOOKUP(K2,A:I,7,FALSE))
 
Upvote 0
Solution
Thank you both for your help, this will free up a lot of my time in analysing the data and actually getting the results I need
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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
Back
Top