COUNTIF problem

Ian Beath

New Member
Joined
Dec 20, 2015
Messages
4
Hi, I am trying to return a value based on a range after a COUNTIF, e.g.

Sheet 1 has the range E6:E34 which lists employee IDs that have worked nightshift in a month
Sheet 1 also has a range M6:M34 which lists the number of nights worked
Sheet 2 has all possible employees by employee ID, i.e. criteria A3:A119

Once I execute the countif, I know they have worked a nightshift, but how do I return the corresponding value from the range M6:M34?

Thanks in advance, this is driving me nuts.

Cheers
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Welcome to Mr Excel

Maybe this formula in B3 of Sheet2
=IF(COUNTIF(Sheet1!$E$6:$E$34,A3),INDEX(Sheet1!$M$6:$M$34,MATCH(A3,Sheet1!$E$6:$E$34,0)),0)
copy down till B119 (last row with data)

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,215,603
Messages
6,125,782
Members
449,259
Latest member
rehanahmadawan

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