Common Value

Waqas ali

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

i have a table named actual. i want to get in query as result.

from actual if Jobid last 4 digits are same than first value should come with second value.

example in result table is shown. i prepared it manually but i want to get through query.

how to write an query?

ActualResult
NameJobidLocationsiteJobTypeNameJobidComonLocationsiteJobType
John17800417-DHWwestDJohn17800417800417-DHWwestD
Dedy19800418-FEQeastDDedy19800417800418-FEQeastD
Pop25994011-LOBwestDPop25994025994011-LOBwestD
Jacob27994015-LOBeastDJacob27994025994015-LOBeastD
Udhay31456321-TOSwestLUdhay31456331456321-TOSwestL
Ashish33456323-TOSeastLAshish33456331456323-TOSeastL

<colgroup><col width="64" span="12" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
What if we have a Waqas entry in Actual with Jobid = 408004? That means three entries where the last four digits are the same.
 
Upvote 0
yes it can be but how to put first one which is lower value to put in next column with matching with last four digits.
 
Upvote 0
yes it can be but how to put first one which is lower value to put in next column with matching with last four digits.

Sorry, I'm not following...

How about...

Row\Col
A​
B​
C​
D​
E​
F​
2​
NameJobidLocationsiteJobTypecommon
3​
John
178004​
17-DHWwestD178004
4​
Dedy
198004​
18-FEQeastD178004 | 408004
5​
Pop
259940​
11-LOBwestD259940
6​
Jacob
279940​
15-LOBeastD259940
7​
Udhay
314563​
21-TOSwestL314563
8​
Ashish
334563​
23-TOSeastL314563
9​
Waqas
408004​
10-XADnorthU178004 | 198004

which does the processing in an additional column?
 
Upvote 0
dear Aladin,

i need in this way.

ow\Col
A​
B​
C​
D​
E​
F​
2​
NameJobidLocationsiteJobTypecommon
3​
John
178004​
17-DHWwestD178004
4​
Dedy
198004​
18-FEQeastD178004
5​
Pop
259940​
11-LOBwestD259940
6​
Jacob
279940​
15-LOBeastD259940
7​
Udhay
314563​
21-TOSwestL314563
8​
Ashish
334563​
23-TOSeastL314563


<tbody>
</tbody>
 
Upvote 0
dear Aladin,

i need in this way.

ow\Col
A​
B​
C​
D​
E​
F​
2​
NameJobidLocationsiteJobTypecommon
3​
John
178004​
17-DHWwestD178004
4​
Dedy
198004​
18-FEQeastD178004
5​
Pop
259940​
11-LOBwestD259940
6​
Jacob
279940​
15-LOBeastD259940
7​
Udhay
314563​
21-TOSwestL314563
8​
Ashish
334563​
23-TOSeastL314563


<tbody>
</tbody>

Dear Waqas ali,

What did you do with the Waqas entry?
 
Upvote 0
Do you mean that there will never be more than two entries (job id's) whose last four digits are equal?


Row\Col
A​
B​
C​
D​
E​
F​
1​
NameJobidLocationsiteJobTypeCommon
2​
John
178004​
17-DHWwestD
178004​
3​
Dedy
198004​
18-FEQeastD
178004​
4​
Pop
259940​
11-LOBwestD
259940​
5​
Jacob
279940​
15-LOBeastD
259940​
6​
Udhay
314563​
21-TOSwestL
314563​
7​
Ashish
334563​
23-TOSeastL
314563​

F2, copied down:
Rich (BB code):

=LOOKUP(9.99999999999999E+307,
   CHOOSE({1,2},B2,LOOKUP(9.99999999999999E+307,
    FIND(RIGHT($B2,4),$B$1:B1),$B$1:B1)))
 
Upvote 0

Forum statistics

Threads
1,221,844
Messages
6,162,346
Members
451,760
Latest member
samue Thon Ajaladin

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