View Single Post
  #3   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

Example setup:

=SUMPRODUCT(LOOKUP(A2:E2,{0,0;"",0;"H",1;"H1",0.5; "T",2;"T1",0.4}))

The last bit between { and } is actually a table. If that table is in a
range, say in L2:M7, laid out like this:

L2: 0
L3: =""
L4: H
L5: H1
L6: T
L7: T1

M2: 0
M3: 0
M4: 1
M5: 0.5
M6: 2
M7: 0.4

and this range is named as STable, then:

=SUMPRODUCT(LOOKUP(A2:E2,STable))

Note that STable is sorted on its first column in ascending order.

Note also that A2:E2, the range of interest, should not house any symbol
which is not in STable.

sbg1275 wrote:
Hi, not sure if this can be done but here goes:

I am creating a attendance spreadsheet (oh such fun) and need to add
staff holidays, and also TOIL to the list.

At the end of the row (for each member of staff) I need to add how many
days holiday has been taken, and in a seperate column how many days
TOIL.

I want to keep the sheet very simple (the CEO needs to be able to
understand it!) and therefore want to be able to use the simple method
of "H" or "T" to indicate Holiday or TOIL - simple enough so far. This
would be easy as I would use the COUNTIF function but ...

.. staff also take half day holidays and TOIL.

So, is there anyway at all of stating that H1/2 = 0.5 and H=1 and then
adding the range together?

Hope this all makes sense - beginning to think that it just can't be
done.

Cheers