How to pick first entry on vlookup and the last entry in diffrent columns

mercmannick

Well-known Member
Joined
Jan 21, 2005
Messages
730
Hi

i have Data imported in from SQL DB and it has multiple entries of a product No.

What i need to do on a seperate excel sheet is in Column I have the first entry on the Row
in Column J have the last entry from a vlookup is this possible

enclosed is a sample of what i am trying to do.

Thanks

[code
riref sched_machine sched_start sched_stop
100342 MOLLART 29/03/2011 08:00 29/03/2011 11:00
100342 MOLLART 29/03/2011 12:00 29/03/2011 14:00
100342 MOLLART 29/03/2011 15:00 29/03/2011 16:00
100342 MOLLART 29/03/2011 17:00 29/03/2011 18:00
103986 MOLLART 29/03/2011 19:00 30/03/2011 05:00
code]
 
All sorted thanks peter

Code:
{=IF(TRIM(C7)="","",MAX(IF(SCHEDULER!$B2:$B25000=TRIM(C7),SCHEDULER!$E2:$E25000)))}

have trailing zeros in col C

Thanks
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
yes you forgot to cover sheet name in 'sheetname'!

Code:
{=IF(C7="","",MAX(IF('SCHEDULER'!$B:$B=C7,'SCHEDULER'!$E:$E)))}
If the sheet name does not contain spaces (as is the case with SCHEDULER), then the ' ' marks are not required around the sheet name.
 
Upvote 0
If the sheet name does not contain spaces (as is the case with SCHEDULER), then the ' ' marks are not required around the sheet name.

Ok thanks Peter

i have another little issue which i didn't foresee, it is doing exactly what i asked but.

i need it to only look at machine operations not just first operation and last operation start and stop times. as you will see from below




this is my data im pulling from SQL

Excel Workbook
ABCDE
51375215155104356CRAVEN829/03/2011 08:0029/03/2011 16:00
51385215173105589CRAVEN829/03/2011 17:0030/03/2011 01:00
51395215182105590CRAVEN830/03/2011 02:0030/03/2011 10:00
51405215189105564CRAVEN830/03/2011 11:0030/03/2011 13:00
51415215195105564CRAVEN830/03/2011 14:0031/03/2011 10:00
SCHEDULER



As you can see i somehow need to just look at current Machine for stop time

could be anything up-to 5 operations on a machine so would need to look at machine first then COL B then end time in COL E

is there a way round doing this (by the way it works on this machine as its final operation is on this machine)

Thanks
 
Upvote 0
Sorry, I can't really make sense of what you want. Can you post a slightly larger sample of SCHEDULER sheet together with the expected results and explanation of why those are the expected results.

Also, when using Excel jeanie, please

- use a copy of your workbook (or a dummy workbook) with just normal size font, not that very large font.

- note that you can use the ‘Analyse range (Forum)’ field near the top left of the Excel jeanie screen to restrict the number of formulas generated. In that field, you can use Ctrl+Click/Drag to select multiple disjoint ranges if required. There is generally no need to display multiple formulas that are basically the same, it just fills up the board. In fact, if these formulas are not producing the results you want, remove them and insert (manually) the results you do want.
 
Upvote 0
Sorry, I can't really make sense of what you want. Can you post a slightly larger sample of SCHEDULER sheet together with the expected results and explanation of why those are the expected results.

Also, when using Excel jeanie, please

- use a copy of your workbook (or a dummy workbook) with just normal size font, not that very large font.

- note that you can use the ‘Analyse range (Forum)’ field near the top left of the Excel jeanie screen to restrict the number of formulas generated. In that field, you can use Ctrl+Click/Drag to select multiple disjoint ranges if required. There is generally no need to display multiple formulas that are basically the same, it just fills up the board. In fact, if these formulas are not producing the results you want, remove them and insert (manually) the results you do want.

Hi Peter

Excel Workbook
BCDEFG
2M/CROLL No.STARTSTOPSHOULD BE STARTSHOULD BE ST0P
7CR810435613/04 15:0022/04 12:0029/03 11:0029/03 19:00
810558906/04 07:0022/04 13:0029/03 20:0030/03 04:00
9*****
10POR110556629/03 11:0015/04 19:0029/03 11:0001/04 04:00
1110556701/04 05:0021/04 03:0001/04 05:0006/04 10:00
12NL410556330/03 11:0018/04 20:0030/03 11:0004/04 11:00
1310553904/04 12:0020/04 18:0004/04 12:0006/04 09:00
14*****
15HK210556419/04 01:0023/04 22:0029/03 09:0030/03 07:00
1610556522/04 12:0022/04 17:0030/03 09:0031/03 07:00
17*****
20HK110197217/04 17:0017/04 22:0029/03 12:0030/03 08:00
2110197318/04 00:0018/04 05:0030/03 09:0031/03 05:00
22*****
Mini Plan (4)




here is the results bit you were asking for i will post the SQL data section next

Thanks
 
Upvote 0
Excel Workbook
BCDE
5309105589CRAVEN829/03/2011 20:0030/03/2011 04:00
5310105590CRAVEN830/03/2011 05:0030/03/2011 13:00
9731105566POREBA129/03/2011 11:0001/04/2011 04:00
9732105567POREBA101/04/2011 05:0001/04/2011 19:00
9733105567POREBA104/04/2011 07:0006/04/2011 10:00
SCHEDULER



here is selection of current DATA from SQL

it is all ROLL no based but each roll could go through a host of machines and each machine would or could have multiple operations each with its own start and stop time

Many Thanks

Nick
 
Upvote 0
Excel Workbook
BCDE
5309105589CRAVEN829/03/2011 20:0030/03/2011 04:00
5310105590CRAVEN830/03/2011 05:0030/03/2011 13:00
9731105566POREBA129/03/2011 11:0001/04/2011 04:00
9732105567POREBA101/04/2011 05:0001/04/2011 19:00
9733105567POREBA104/04/2011 07:0006/04/2011 10:00
SCHEDULER



here is selection of current DATA from SQL

it is all ROLL no based but each roll could go through a host of machines and each machine would or could have multiple operations each with its own start and stop time

Many Thanks

Nick

What are the desired results so we don't need to read the whole thread?
 
Upvote 0
Hi Aladin Akyurek

the Sheet in post 15 is the results i am getting and the next two columns is the results i need

Many Thanks
 
Upvote 0
Hi Aladin Akyurek

the Sheet in post 15 is the results i am getting and the next two columns is the results i need

Many Thanks

I now think I shouldn't have entered into such a lengthy thread...

However, you could make everybody happy if you provide very small sample along with the desired results with no formulas at all. Possible?
 
Upvote 0

Forum statistics

Threads
1,225,156
Messages
6,183,222
Members
453,152
Latest member
ChrisMd

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