Max Value and Sum from a data set that appears to be duplicate: VBA

shockey8oz

New Member
Joined
Sep 17, 2012
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Good afternoon-

I am attempting to find the max value from two data sets which appear to be duplicates. The data comes from two separate workbooks that I have bought into a combined data workbook. I have used a pivot table on the data; however, I am not getting my ideal results.

In the example, there are two data sets from the state of Iowa. One is from the East (Row 2-Row 16) and one from the West (Row 17-Row 36). The report does not differentiate between the two. The data sets will not always have the same number of data points. The report has a state, date, and hour of when a widget was in use. I need the max number of widget A and widget B in use during the duration of the event for each data set and sum that together.

In the example, Widget A would be 22 using the data in row 3 (4 widgets) & 18 (18 widgets). Widget B would be 10 using the data in row 14 (3 widgets) and row 33 (7 widgets).

I think the best solution would the best solution be to append column A with a differentiator? (IA - E, IA - W) Then, pivot table, then max value, then sum.

What is the best way to do that?

eot-summary (9).csv
ABCDE
1StateDateHourWidget AWidget B
2IA12/16/20211030
3IA12/16/2021940
4IA12/16/2021820
5IA12/16/2021720
6IA12/16/2021620
7IA12/16/2021520
8IA12/16/2021420
9IA12/16/2021320
10IA12/16/2021220
11IA12/16/2021122
12IA12/16/2021022
13IA12/15/20212322
14IA12/15/20212213
15IA12/15/20212103
16IA12/15/20212001
17IA12/16/202110181
18IA12/16/20219181
19IA12/16/20218183
20IA12/16/20217173
21IA12/16/20216153
22IA12/16/20215153
23IA12/16/20214153
24IA12/16/20213153
25IA12/16/20212133
26IA12/16/20211122
27IA12/16/20210122
28IA12/15/202123102
29IA12/15/20212281
30IA12/15/20212155
31IA12/15/20212026
32IA12/15/20211916
33IA12/15/20211807
34IA12/15/20211705
35IA12/15/20211603
36IA12/15/20211502
Sheet145
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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