VLookup with If statement (?)

DebraC

New Member
Joined
Nov 29, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I need assistance with how to set up an Excel formula that allows me to take a hire date and use it to find the pay date that is closest yet exceeds the hire date (i.e. future) and returns a remaining number of pay cycles number from an adjacent column, so that we can calculate offer letter PTO dates for the hire year.

So in B17, I want to return the number of remaining pay periods in the year from column B29 (which goes to 26 pay periods, but it's cut off in the snippet below).

Here is a snippet from my table:

1669775162487.png


Thank you!
 

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
Hi DebraC,

Welcome to MrExcel!!

Assuming the "Hire Date" range is A29:A39 and the "Pay Pd" range is B29:B39 (amend the following to suit if not) try this array formula* in cell B17:

{=MIN(IF($A$28:$A$39>$B$13,$B$28:$B$39))}

Regards,

Robert

* You need to press Ctrl+Shift+Enter to complete (enter) an array formula. Do not just add the curly brackets manually.
See here for more details.
 
Upvote 0
* You need to press Ctrl+Shift+Enter to complete (enter) an array formula. Do not just add the curly brackets manually.
@Trebor76
The OP has Excel 365 so formulas do not require array entry

@DebraC
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. You will generally get faster/better responses. :)

So in B17, I want to return the number of remaining pay periods in the year from column B29 (which goes to 26 pay periods,
Like this?

22 11 30.xlsm
AB
131/03/2023
14
15
16
1722
18
27
281/01/2023
296/01/20231
3020/01/20232
313/02/20233
3217/02/20234
333/03/20235
3417/03/20236
3531/03/20237
3614/04/20238
3728/04/20239
3812/05/202310
3926/05/202311
409/06/202312
4123/06/202313
427/07/202314
4321/07/202315
444/08/202316
4518/08/202317
461/09/202318
4715/09/202319
4829/09/202320
4913/10/202321
5027/10/202322
5110/11/202323
5224/11/202324
538/12/202325
5422/12/202326
Pay periods
Cell Formulas
RangeFormula
B17B17=COUNTIF(A29:A54,">"&B13)
 
Upvote 0
The OP has Excel 365 so formulas do not require array entry

Thanks Peter. So 365 is smart enough to set the formula as an array? So I take it that that means they're not as memory hungry as in previous versions?
 
Upvote 0
Thanks Peter. So 365 is smart enough to set the formula as an array? So I take it that that means they're not as memory hungry as in previous versions?
365 tries to evaluate all formulas as array formulas. I'm not sure about the effect on memory usage, but practically it is much easier not having to remember C+S+E.
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

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