Returning a text value that matches 2 conditions

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,013
I have worked this out how to return a numerical value but not a text value

In column B is the employees payroll number, in column G is the date they start their leave and in column H is when they finish their leave

On another sheet Is 'Employee A's payroll number in cell E5 with a date in G4

What I want is, if E5 can be found in Column B and if G4 can be found in column H then it should return the value from column D

The payroll number in B and the dates in column G can appear muliple times, so this should only return a value if both date and payroll number match.. Any ideas please ?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Try something like:

=INDEX(Sheet1!$D$2:$D$100,MATCH(1,(Sheet1!$B$2:$B$100=E5)*(Sheet1!$H$2:$H$100=G4),0))

Confirmed with Ctrl+Shift+Enter as it's an array formula.

Dom
 

Watch MrExcel Video

Forum statistics

Threads
1,129,800
Messages
5,638,427
Members
417,025
Latest member
MusterDuster

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
Top