If cell matches data in a range of other cells show match

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
322
Office Version
  1. 365
Platform
  1. Windows
Hello peeps,

I have a sheet for calculating working days between two dates (Calculator) and a sheet with year by year bank holidays ('UKBH').

I've put data validation in Calculator!C4 based on the years in UKBH!B2:I2. Start date is in Calculator!C6 and end date is in Calculator!C8.

I want the relevant year's holidays (ranging from 7 to 10 entries (rows beneath year)) to show in a separate column on UKBH! (K) when a user selects the year from Calculator!C4. Column K will then be part of my formula in Calculator!C8 '=IFERROR(IF($C6="","",IF($C8="",NETWORKDAYS($C6,TODAY()-1,UKBH!$K$3:$K$12),NETWORKDAYS($C6,$C8-1,UKBH!$K$3:$K$12))),"")'

I've tried a range of formulas from VLOOKUP to MATCH, but am now tying myself up in knots.

Any help would be appreciated :giggle:
 
Ah, re the working days, I remembered I had to minus 1 day because of the way the formula calculates and the way we record the days; so, that's fine. It would just be handy to know what I'm doing wrong with the return holiday dates for that period though...:unsure:

Sorry that my last posts were misleading.

You're not using the NETWORKDAYS.INTL function in J8.

try this:
Excel Formula:
=NETWORKDAYS.INTL(J4,J6-1,1,J11:J20)
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
No worries; I have the formula calculating the correct working days minus bank holidays, and I don't really need the bank holiday dates to show, but just wondered why I couldn't return the BH dates between the period like you (C11:C21 not G11:G21 as there's only one BH in that period)...?

Void Loss Working Days Calculator.xlsx
BCDEFG
2Void Loss - Working DaysVoid Loss - Working Days
3
4Enter TTD:20/07/2022Enter TTD:07/05/2023
5
6Enter TSD:21/07/2023Enter TSD:15/05/2023
7
8Working days:255Working days:4
9
10
1129/08/202215/04/202208/05/2023
1229/08/202218/04/202208/05/2023
1329/08/202202/05/202208/05/2023
1429/08/202202/06/202208/05/2023
1529/08/202203/06/202208/05/2023
1629/08/202229/08/202208/05/2023
1729/08/202226/12/202208/05/2023
1829/08/202227/12/202208/05/2023
1929/08/202202/01/202308/05/2023
2029/08/202207/04/202308/05/2023
2129/08/202210/04/202308/05/2023
2201/05/2023
2308/05/2023
2429/08/2023
2528/08/2023
2625/12/2023
2726/12/2023
2801/01/2024
2929/03/2024
3001/04/2024
3106/05/2024
3227/05/2024
3326/08/2024
3425/12/2024
3526/12/2024
3601/01/2025
3718/04/2025
3821/04/2025
3905/05/2025
4026/05/2025
4125/08/2025
4225/12/2025
4326/12/2025
4401/01/2026
4503/04/2026
4606/04/2026
4704/05/2026
4825/05/2026
4931/08/2026
5025/12/2026
5128/12/2026
5201/01/2027
5326/03/2027
5429/04/2027
5503/05/2027
5631/05/2027
5730/08/2027
5827/12/2027
5928/12/2027
6003/01/2028
6114/04/2028
6217/04/2028
6301/05/2028
6429/05/2028
6528/08/2028
6625/12/2028
6726/12/2028
6801/01/2029
6930/03/2029
7002/04/2029
7107/05/2029
7228/05/2029
7327/08/2029
7425/12/2029
7526/12/2029
7601/01/2030
Calculator (3)
Cell Formulas
RangeFormula
C8C8=NETWORKDAYS.INTL(C4,C6,1,HolidayList)
G8G8=IF(G4="","",NETWORKDAYS.INTL(G4,G6,1,HolidayList)-1)
C11:C21C11=INDEX(HolidayList,MATCH($C$4,HolidayList,1)+1,1):INDEX(HolidayList,MATCH($C$6,HolidayList,1),1)
G11:G21G11=INDEX(HolidayList,MATCH($G$4,HolidayList,1)+1,1):INDEX(HolidayList,MATCH($G$6,HolidayList,1),1)
Press CTRL+SHIFT+ENTER to enter array formulas.
Named Ranges
NameRefers ToCells
'Calculator (3)'!HolidayList='Calculator (3)'!$E$11:$E$76G8, C8, C11:C21, G11:G21
Cells with Data Validation
CellAllowCriteria
C4Datebetween 01/01/1900 and 31/12/3000
C6Datebetween 01/01/1900 and 31/12/3000
G4Datebetween 01/01/1900 and 31/12/3000
G6Datebetween 01/01/1900 and 31/12/3000
 
Upvote 0
well, I just looked at it.
There is only 1 holiday in the range specified.

When you enter that formula in the cell, you may need to enter it with the array enter keys: CNTL-SHFT-ENTR
And the result spills, you do not copy the formula down the column, it should spill.

Unless you're in Excel 2010 and it does not spill. (Please advise).
 
Upvote 0
Ah, of course! Apologies, that's my ignorance around array/spill formulas - and, yes, is now working perfectly! (I use Excel 365.)

Thank you so much for you help and patience, @awoohaw :giggle:
 
Upvote 0
Ah, of course! Apologies, that's my ignorance around array/spill formulas - and, yes, is now working perfectly! (I use Excel 365.)

Thank you so much for you help and patience, @awoohaw :giggle:
I am pleased you found a solution at the Mr. Excel Forum. I enjoy excel challenges. There are some other folks here much more skilled at excel than me, and I have learned quite a bit here as well.

Best Wishes!
 
Upvote 1

Forum statistics

Threads
1,215,073
Messages
6,122,977
Members
449,095
Latest member
Mr Hughes

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