If and Blanks provide data

Jmayfield4

New Member
Joined
Feb 13, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Okay all, I have tried so many things to get this to work and its not. So here I am asking for help again!

1675204662018.png

Above is my table (Figure 1) with the column heads, let's all just pretend that the very first line of data is row 2.

1675204982479.png

This is lookup table (Figure 2).


What I need is a formula to check and see if Months_Between has data, if no data, then check and see if Date_Hired_2 has data, if no data, return "Vacant". Now, if Months_Between has data, then use Lookup formula, to match range value of Months_Between in figure 2 and return the corresponding data. If Months_Between has no data, but Date_Hired_2 has data, return "Active".

So, what I think, and it has not been working is:

=IF(AND(ISBLANK(Months_Between),ISBLANK(Date_Hired_2)),"Vacant",IF(ISBLANK(Months_Between),"Active",LOOKUP(Months_Between),Figure2!$A$1:$A$4,Figure2!$B$1:$B$4)))

Any help????
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I think this works (it appeared to do so for me):

=IF(AND([@[Term Date 2]]="",[@[Date Hired]]=""), "Vacant", IF([@[Months Between]]<>"", VLOOKUP([@[Months Between]],$R$2:$S$5,2,FALSE),IF([@[Date Hired]]<>"","Active","")))

HTH
 
Upvote 0
I think this works (it appeared to do so for me):

=IF(AND([@[Term Date 2]]="",[@[Date Hired]]=""), "Vacant", IF([@[Months Between]]<>"", VLOOKUP([@[Months Between]],$R$2:$S$5,2,FALSE),IF([@[Date Hired]]<>"","Active","")))

HTH
This worked but just had to change from VLOOKUP to LOOKUP and use the absolute ranges. Thank you so much for your help!! I spent a majority of the day trying various formulas to get this to work.
 
Upvote 0
glad it helped - I've not used LOOKUP, but will probably do so now you've reminded me of it! :)
 
Upvote 0

Forum statistics

Threads
1,215,112
Messages
6,123,162
Members
449,099
Latest member
afishi0nado

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