Thread: formula for sum
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default formula for sum

Try these array formulas** :

For "B" overtime:

=SUM(IF(LEFT(B2:B32)="B",--MID(B2:B32,2,2)))

For "C" overtime:

=SUM(IF(LEFT(B2:B32)="C",--MID(B2:B32,2,2)))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"afdmello" wrote in message
...
In a worksheet I have 30 or 31 days in a month marked ina row
For overtime I am using the following rule

B for one rate, C for another and then writing the number of hours beside
the letter for eg
B2 stands for 2 hours OT
B10 stands for 10 hours OT
similarly C2 stands for 2 hours OT with C rate

My intention is for excel to find out all the B's and ONLY sum the
numbers(hours) beside them and give the result In a cell for the month
Similarly for C rate find the Sum and give the result in another cell

Hope you gurus can generate something to ease my troubles of manaul
counting
Afd