Sumproduct with text answer

Dickerswastic

New Member
Joined
Aug 27, 2011
Messages
4
I am trying to do a leave booking worksheet. On sheet 1 I have employee numbers in column A and dates in row 4 ie 29/7, 30/7, etc. In sheet 2 I have a data download with employee number in column A, date of leave from in column B, date of leave to in column C and a leave type in column D.

I want to look up the employee number, date from >= row date, date to <= row date and return the leave type in the cell.

So I need a sumproduct type code. Your help would be appreciated.

Cheers
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Without using sumproduct, this formula seems to work for me...
=IF(AND(B$4>=VLOOKUP($A5,Sheet2!$A$2:$D$19,2,0),B$4<=VLOOKUP($A5,Sheet2!$A$2:$D$19,3,0)),VLOOKUP($A5,Sheet2!$A$2:$D$19,4,0),"")
This was placed into cell B5 on Sheet 1, then copied across, then down.
Hope this is what you're seeking...
Larry.
 
Upvote 0
Without using sumproduct, this formula seems to work for me...
=IF(AND(B$4>=VLOOKUP($A5,Sheet2!$A$2:$D$19,2,0),B$4<=VLOOKUP($A5,Sheet2!$A$2:$D$19,3,0)),VLOOKUP($A5,Sheet2!$A$2:$D$19,4,0),"")
This was placed into cell B5 on Sheet 1, then copied across, then down.
Hope this is what you're seeking...
Larry.

Thanks Larry, you're a legend
 
Upvote 0
Happy to help. Signing off now. Hurricane Irene requires my utmost attention! Larry.

Hi Larry

Hope you are OK with Irene.

Sorry forgot to mention that the list might have more than one entry for a person. Using vlookup returns only the first line item of that person.

eg
18/8/11-19/8/11 Annual Leave
20/8/11-21/8/11 Leave without pay

So on sheet 1 I need it to differentiate.

Cheers
Nick
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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