SOLVED

Help with VLOOKUP and nested IF formula, if that is what is required to solve my problem?

Copper Contributor

I am trying to find the number of staff employed in a month by asking Excel to look up in a column for the words 'Basic Salary' and then look x columns across a table to see if there is a value greater than 0, if that is the case to return a value of 1 and then add up each of those results so that we know how many staff are working each month.  I would like to copy the formula across cells so I can continue to expand the spreadsheet.

 

 Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17Oct-17Nov-17Dec-17Jan-18
             
Basic Salary4,2004,2004,2004,2002,980638504850485050
Commissions6,6926,1242,4247,8852,610645      
Guarantees            
Employers NI1,5331,4559441,69800000000
Employee Benefits            
Staff Recruitment Fees            
Vehicle - Car Allowance90090090090000000000
             
             
Basic Salary464646465,0005,0005,0005,000    
Commissions6921,5161,2271,7352,1271,3861,3861,386    
Guarantees            
Employers NI91204165235972870870870    
Employee Benefits            
Staff Recruitment Fees            
Vehicle - Car Allowance600600600600600600600600    
             
             
Basic Salary3,7503,7503,7502,412441   50485050
Commissions2,7316,9831,6411,2741,030       
Guarantees            
Employers NI8591,44670900   0000
Employee Benefits            
Staff Recruitment Fees            
Vehicle - Car Allowance42542542500   0000
             
             
Basic Salary     2,1672,1672,1672,1672,1671,6122,167
Commissions     000555045074
Guarantees      4504500000
Employers NI     245307307322245238255
Employee Benefits            
Staff Recruitment Fees            
Vehicle - Car Allowance     290290290290290214290
             
             
Basic Salary      3,3333,3333,3334,001  
Commissions      791241,260435  
Guarantees            
Employers NI      436442599534  
Employee Benefits            
Staff Recruitment Fees            
Vehicle - Car Allowance      425425425353  
             
             

 

5 Replies

I'm attaching a spreadsheet that I think works. It uses this formula to count up the number of basic salaries in a given month:

=COUNTIFS(tbl_data[[Column1]:[Column1]],"Basic Salary",tbl_data[Feb-17],">0")

 

countifs lets you count something that matches more than 1 criteria, in this case that in column 1 the row says Basic salary, and in the Feb-17 column there is a number in there that is greater than 0.

 

When you drag this formula right, 'month' column will move right as well

best response confirmed by R Leman (Copper Contributor)
Solution

Dear R Leman

plz chk the attached file Green colored cells

Thanks doesn't quite do the copy across.  Have checked other reply to my original and it works - thanks very much for your help though

Perfect, this did it exactly - really useful, have been trying to solve this one for a week!  Thanks very much for your help, much appreciated

1 best response

Accepted Solutions
best response confirmed by R Leman (Copper Contributor)
Solution

Dear R Leman

plz chk the attached file Green colored cells

View solution in original post