lundi 16 juillet 2018

Using vlookup to another sheet with multiple if statements

Name    Contractor  Maintain   On Payroll  Salary 
Ben     N   Y   Y   £87
Drew    N   N   Y   £48
Maria   N   Y   Y   £65
Martin  N   N   Y   £62
Lucy    N   N   N   £38
Andy    N   N   N   £65
Chris   N   Y   N   £80

I have the above information in Sheet1.

I want to do a vlookup which takes all the names of Sheet1 and then according to various conditions based on:

If payroll now
      If not going to be on payroll, salary goes to 0 in 1 month, else stay on payroll
If not on payroll now
      If not going to be on payroll, stay at 0, else start on payroll in 3 months from today

In Sheet2, I use:

=IMPORTRANGE("Linktosheet","Sheet1!A2:F37") 

to get all the above apart from the salary numbers.

I then create all the logic, and Sheet 2 should look like (current date is 16 July '18):

                    July '18  Aug '18  Sep '18 Oct '18
Ben     N   Y   Y   £87       £87      £87     £87   
Drew    N   N   Y   £48       £48      0       0 
Maria   N   Y   Y   £65       65       65      65
Martin  N   N   Y   £62       62 .     0 .     0
Lucy    N   N   N   0 .       0 .      0 .     0 
Andy    N   N   N   0 .       0 .      0 .     0
Chris   N   Y   N   0 .       0  .     0 .     80

Assuming current date is July '18.

For some reason, using multiple IF statements, my array formula vlookup picks up the totally wrong numbers when I do a vlookup and the formulas all match to the right places on Google sheets. Any idea what is going wrong?

Aucun commentaire:

Enregistrer un commentaire