I want that excel returns in five cells the first 5 values corresponding to a given name

IceSnakeR

New Member
Joined
Aug 4, 2017
Messages
13
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

I need a bit of help with the next situation:

There are two columns, in the first (A) there are two names(PAUL and JOHN) inserted from cell A2 till cell A16, in the second column there are hours. How can i return the first five values(hours) corresponding to JOHN?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]NAME[/TD]
[TD]HOUR[/TD]
[TD][/TD]
[TD]First 5 Hours corresponding to John[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]00:05:46[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]02:05:46[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:35:46[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]00:25:46[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]00:15:46[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]03:05:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]03:04:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]00:02:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:05:43[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:35:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:05:44[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]02:55:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]02:05:45[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thank you,
Chris
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hello,

I need a bit of help with the next situation:

There are two columns, in the first (A) there are two names(PAUL and JOHN) inserted from cell A2 till cell A16, in the second column there are hours. How can i return the first five values(hours) corresponding to JOHN?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]NAME[/TD]
[TD]HOUR[/TD]
[TD][/TD]
[TD]First 5 Hours corresponding to John[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]00:05:46[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]02:05:46[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:35:46[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]00:25:46[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]00:15:46[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]03:05:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]03:04:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]00:02:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:05:43[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:35:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]00:05:44[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]02:55:46[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PAUL[/TD]
[TD]02:05:45[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thank you,
Chris

D2 = INDEX($B$2:$B$14,SMALL(IF($A$2:$A$14="John",ROW($A$2:$A$14),""),$C2)-1) press CTEL+SHIFT+ENTER
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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