Not to show Repeating same values

Waqas ali

Board Regular
Joined
Nov 6, 2010
Messages
163
Dear Experts,

in below table i have startedjob and endjob columns in these columns repeating values are existing.

i want to show in startedjob first value and in endjob is last value from these repeating values and don't want to show other repeating values.

i want to calculate in new columns of these startedjob and endjob time.

can any one assist me how can i do this?




Conn_IdsenderDeskAddJobIdstartedJobConn_TimeDisConnendJobConnSecond
20160301001122175194A-B0250001102401-Mar-16 00:10:1301-Mar-16 00:11:4201-Mar-16 00:11:4501-Mar-16 00:13:3603
20160301002156079926A-B0250016102501-Mar-16 00:21:37 01-Mar-16 00:22:1601-Mar-16 00:22:2101-Mar-16 00:24:5805
20160301002221579807A-B0250016102501-Mar-16 00:21:3701-Mar-16 00:22:4101-Mar-16 00:22:4801-Mar-16 00:24:5807
20160301002248377012A-B0250015102501-Mar-16 00:21:3701-Mar-16 00:23:0801-Mar-16 00:23:3101-Mar-16 00:24:5823
20160301002916558650A-B0250012102601-Mar-16 00:28:3601-Mar-16 00:29:3601-Mar-16 00:30:0001-Mar-16 00:31:4424
20160301005953042634A-B0250001102701-Mar-16 00:57:4601-Mar-16 01:00:1201-Mar-16 01:00:2001-Mar-16 01:04:4808
20160301010201472532A-B0250015102701-Mar-16 00:57:4601-Mar-16 01:02:2101-Mar-16 01:04:4801-Mar-16 01:04:4827
20160301010201472532A-B0250015102801-Mar-16 01:04:4901-Mar-16 01:04:4901-Mar-16 01:04:5001-Mar-16 01:06:2101
20160301010944024953A-B0250016103001-Mar-16 01:06:5301-Mar-16 01:10:0301-Mar-16 01:10:1601-Mar-16 01:15:1413
20160301011208011020A-B0250012103001-Mar-16 01:06:5301-Mar-16 01:12:2701-Mar-16 01:14:2301-Mar-16 01:15:1456
20160301011712430296A-B0250015103101-Mar-16 01:15:1601-Mar-16 01:17:3201-Mar-16 01:18:3101-Mar-16 01:18:3159
20160301012803133844A-B0250015103201-Mar-16 01:27:1301-Mar-16 01:28:2301-Mar-16 01:28:5301-Mar-16 01:30:2030
20160301013347117971A-B0250001103301-Mar-16 01:32:3301-Mar-16 01:34:0701-Mar-16 01:35:2801-Mar-16 01:35:2821
20160301013347117971A-B0250001103401-Mar-16 01:35:3101-Mar-16 01:35:3101-Mar-16 01:35:3101-Mar-16 01:39:5700
20160301013706378677A-B0250016103401-Mar-16 01:35:3101-Mar-16 01:37:2601-Mar-16 01:39:5701-Mar-16 01:39:5731

<tbody>
</tbody>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
If you remove the fields that are not repeating you can use DISTINCT:

Code:
SELECT DISTINCT AddJobId, startedJob, endJob FROM Table1
 
Upvote 0
Forget about it. I though this was an Excel question...

Hi
Assming AddJobId is column D, startedJob is column E, endJob is column H and actual data are in rows 2 to 16.
Create 3 columns (K, L and M) with Title UAddJobId, MinStartedJob, MaxEndJob. In the 3 formulas replace ; with , if this is your usual separator

In K2:
=IF(ROW(1:1)>SUMPRODUCT( ($D$2:$D$16 <> "") / COUNTIF($D$2:$D$16; $D$2:$D$16&"") );""; INDEX($D$1:$D$16;SMALL(IF(FREQUENCY($D$2:$D$16;$D$2:$D$16);ROW($D$2:$D$16)); ROW(1:1));1))
Validate with [Ctrl]+[Shift]+[Enter] as this is an array formula. Then copy it down until row 16 with this example

In L2:
=IF(ROW(1:1)>SUMPRODUCT( ($D$2:$D$16 <> "") / COUNTIF($D$2:$D$16; $D$2:$D$16&"") );""; MIN( IF($D$2:$D$16=$K2; $E$2:$E$16)))
Validate with [Ctrl]+[Shift]+[Enter] as this is an array formula. Then copy it down until row 16 with this example

In M2:
=IF(ROW(1:1)>SUMPRODUCT( ($D$2:$D$16 <> "") / COUNTIF($D$2:$D$16; $D$2:$D$16&"") );""; MAX( IF($D$2:$D$16=$K2; $H$2:$H$16)))
Validate with [Ctrl]+[Shift]+[Enter] as this is an array formula. Then copy it down until row 16 with this example

1st formula brings you a list of Unique AddJobId. 2nd formula brings you the earliest date/time by JobId. 3rd formula brings you the latest date/time by JobId

Regards
XLearner
 
Last edited:
Upvote 0
thanks for both,

it is not excel file this data in access table and distinct will not work because jobstarted time and endtime is unique but Conn_Time and DisConn can be more than one in between jobstarted time and end time for the dame jobId.

i want to show for each jobid jobstarted time and endtime only once but if conn_time and disconn is exist more than one also show all.

this how can i do it because i have to calculate jobstarted and endtime against each job and in between how many times machine is connected and disconnected with particular job also to be calculate.
 
Upvote 0
You can do it only separately, not together, because this implies different types of grouping. Possibly it can be done in an access Report.
 
Upvote 0

Forum statistics

Threads
1,221,819
Messages
6,162,155
Members
451,749
Latest member
zack_ken

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