Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default VLOOKUP with 2 Conditions

Hello,

Sheet 1 is the Data and Sheet 2 is the result I need.

Sheet 1: (DATA)
A B
1 GROUP 1 Hours:Minutes
2 **HOLIDAY 421:35
3 ~SHIFT 4560:25
4 OT 851:43
5 *UNDERTIME 48:52
6 GROUP 2 Hours:Minutes
7 SHIFT 3821:56
8 OT 450:21
9 *VACATION 68:25

SHEET 2 (Result)

A B C
1 SEGMENTS GROUP 1 GROUP 2
2 SHIFT 4560:25 3821:56
3 OT 851:43 450:21
4 HOLIDAY 421:25 0
5 VACATION 0 68:25
6 UNDERTIME 48:52 0

How can I use VLOOKUP to get the result I need? I actually have 20 Groups
and have different segments in each group. Is there other formula I can use?

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default VLOOKUP with 2 Conditions

I would use a helper column. Insert a column in Sheet1 at column A. Now
your segment information and hours are in columns B and C. Then put this
formula in A2 and copy down

=INDEX(B$1:B2,MAX(ISNUMBER(SEARCH("Group",B$1:B2)) *ROW(INDIRECT("1:"&ROWS(B$1:B2)))))&" "&B2

It's an array formula, so hit Ctrl+Shift+Enter after typing it in or
copy/pasting it in.

Then enter this in Sheet2!B2

=IF(ISNA(MATCH(B$1&" "&$A2,Sheet1!$A$2:$A$9,0)),0,VLOOKUP(B$1&"
"&$A2,Sheet1!$A$2:$C$9,3,0))


"al_ba" wrote:

Hello,

Sheet 1 is the Data and Sheet 2 is the result I need.

Sheet 1: (DATA)
A B
1 GROUP 1 Hours:Minutes
2 **HOLIDAY 421:35
3 ~SHIFT 4560:25
4 OT 851:43
5 *UNDERTIME 48:52
6 GROUP 2 Hours:Minutes
7 SHIFT 3821:56
8 OT 450:21
9 *VACATION 68:25

SHEET 2 (Result)

A B C
1 SEGMENTS GROUP 1 GROUP 2
2 SHIFT 4560:25 3821:56
3 OT 851:43 450:21
4 HOLIDAY 421:25 0
5 VACATION 0 68:25
6 UNDERTIME 48:52 0

How can I use VLOOKUP to get the result I need? I actually have 20 Groups
and have different segments in each group. Is there other formula I can use?

Thanks in advance!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default VLOOKUP with 2 Conditions

Hi JMB,

This one worked! I just have to make some tweakings to match my data.
The formula is new to me but I am learning. :)
Thank you for your time and help!! :)

"JMB" wrote:

I would use a helper column. Insert a column in Sheet1 at column A. Now
your segment information and hours are in columns B and C. Then put this
formula in A2 and copy down

=INDEX(B$1:B2,MAX(ISNUMBER(SEARCH("Group",B$1:B2)) *ROW(INDIRECT("1:"&ROWS(B$1:B2)))))&" "&B2

It's an array formula, so hit Ctrl+Shift+Enter after typing it in or
copy/pasting it in.

Then enter this in Sheet2!B2

=IF(ISNA(MATCH(B$1&" "&$A2,Sheet1!$A$2:$A$9,0)),0,VLOOKUP(B$1&"
"&$A2,Sheet1!$A$2:$C$9,3,0))


"al_ba" wrote:

Hello,

Sheet 1 is the Data and Sheet 2 is the result I need.

Sheet 1: (DATA)
A B
1 GROUP 1 Hours:Minutes
2 **HOLIDAY 421:35
3 ~SHIFT 4560:25
4 OT 851:43
5 *UNDERTIME 48:52
6 GROUP 2 Hours:Minutes
7 SHIFT 3821:56
8 OT 450:21
9 *VACATION 68:25

SHEET 2 (Result)

A B C
1 SEGMENTS GROUP 1 GROUP 2
2 SHIFT 4560:25 3821:56
3 OT 851:43 450:21
4 HOLIDAY 421:25 0
5 VACATION 0 68:25
6 UNDERTIME 48:52 0

How can I use VLOOKUP to get the result I need? I actually have 20 Groups
and have different segments in each group. Is there other formula I can use?

Thanks in advance!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default VLOOKUP with 2 Conditions

glad to hear that worked.

"al_ba" wrote:

Hi JMB,

This one worked! I just have to make some tweakings to match my data.
The formula is new to me but I am learning. :)
Thank you for your time and help!! :)

"JMB" wrote:

I would use a helper column. Insert a column in Sheet1 at column A. Now
your segment information and hours are in columns B and C. Then put this
formula in A2 and copy down

=INDEX(B$1:B2,MAX(ISNUMBER(SEARCH("Group",B$1:B2)) *ROW(INDIRECT("1:"&ROWS(B$1:B2)))))&" "&B2

It's an array formula, so hit Ctrl+Shift+Enter after typing it in or
copy/pasting it in.

Then enter this in Sheet2!B2

=IF(ISNA(MATCH(B$1&" "&$A2,Sheet1!$A$2:$A$9,0)),0,VLOOKUP(B$1&"
"&$A2,Sheet1!$A$2:$C$9,3,0))


"al_ba" wrote:

Hello,

Sheet 1 is the Data and Sheet 2 is the result I need.

Sheet 1: (DATA)
A B
1 GROUP 1 Hours:Minutes
2 **HOLIDAY 421:35
3 ~SHIFT 4560:25
4 OT 851:43
5 *UNDERTIME 48:52
6 GROUP 2 Hours:Minutes
7 SHIFT 3821:56
8 OT 450:21
9 *VACATION 68:25

SHEET 2 (Result)

A B C
1 SEGMENTS GROUP 1 GROUP 2
2 SHIFT 4560:25 3821:56
3 OT 851:43 450:21
4 HOLIDAY 421:25 0
5 VACATION 0 68:25
6 UNDERTIME 48:52 0

How can I use VLOOKUP to get the result I need? I actually have 20 Groups
and have different segments in each group. Is there other formula I can use?

Thanks in advance!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup with conditions Sam Excel Worksheet Functions 2 April 17th 07 12:30 PM
Vlookup with conditions Curtis Excel Worksheet Functions 6 November 19th 06 03:18 AM
VLOOKUP with 2 conditions RSantos Excel Discussion (Misc queries) 5 June 26th 06 06:11 PM
Vlookup with 3 or more conditions LondonLion Excel Worksheet Functions 1 December 28th 05 04:02 PM
How do you do a VLookup with two conditions? ryesworld Excel Worksheet Functions 8 November 28th 05 10:57 PM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"