You are here:

Excel/Usiusing two criteria to return a value from a table

Advertisement


Question
Hi, I have a table with my work hours and shift type. Like this A=date b=clock in c=clock out d=shift type. In another table I would like to calc my salery.

Table indata
  A          B      C      D  
1 01.12.2012  08:00  16:00  LA
2 03.12.2012  16:00  23:00  UL

Table salery
 A          B      C       D
1 01.12.2012  08:00  16:00  $xxxx
2 02.12.2012  
3 03.12.2012  16:00  23:00  $xxxx

Looking for a formal that will populate B and C in table salery if I have work that day and if shift is LA or UL

Right now I am using for B1 =INDEX(indata!B1:B13,MATCH(1,(indata!A3:A13=A1)*(indata!D1:D13="LA"),0))

But I am not geting shift UL.

1) How can I get my UL shift to my table?
2) If in the future I get a new shift type like XL. How can I get this shift in my table without change my formal?

PS I was thinking of having a list of valid shift types

Hope you understand my problem and have a easy solution

Best regards
Frode

Answer
Frode:

Extra) Your formula has an error...it should be indata!A1:A13=A1.  Maybe that is just a typo?

1) You need to change the part that says indata!D1:D13="LA"to indata!D1:D13="UL" in order to return shift UL.

2) In order to eliminate the need to change the formula you would have to have the shift type also appear in the Table Salary sheet, perhaps in column E.  Then, instead of indata!D1:D13="LA", you would use indata!D1:D13=E1

I suspect you may not be the author of the formula listed above... and that you have actually tried to change LA to UL and it didn't work #it reported #N/A#.  The above is an array formula, and when being entered, it must be confirmed with CTRL-SHIFT-ENTER instead of simply ENTER.

Sincerely,

Nathan  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Nathan

Expertise


This expert requires a donation of $5 for questions answered (satisfaction guaranteed). Isn't $5 a value for this experts time?
Microsoft Excel questions related to advanced formulas, Pivot Tables, filters, forms, graphs, and just about anything else (EXCEPT Visual Basic Coding/Programming and Macros, I don't answer questions in those categories).

Experience

I have been using spreadsheets since Lotus 1-2-3 was released.

Education/Credentials
Certified Public Accountant (CPA)

©2016 About.com. All rights reserved.