Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 173
Default Problem in calculating the outcome

Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
....
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 173
Default Problem in calculating the outcome

Typo is "So, wanna calculate the total hours for shift 4 regardless who did
it..."

Also, want to use a formula that can help me to work out the total hours
under certain shift.
In this case, if I want to calculate the shift 4, answer is 9.
If I want to calculate the shift 3, anwer is 6 ...
Thanks So much

"Elton Law" wrote:

Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
...
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Problem in calculating the outcome

Elton Law wrote:
Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
...
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks



Look he

http://www.contextures.com/xlFunctions01.html#SumIf
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Problem in calculating the outcome

Hi,

Try this

=SUMPRODUCT((B2:H2=4)*(B3:H3))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Elton Law" wrote:

Typo is "So, wanna calculate the total hours for shift 4 regardless who did
it..."

Also, want to use a formula that can help me to work out the total hours
under certain shift.
In this case, if I want to calculate the shift 4, answer is 9.
If I want to calculate the shift 3, anwer is 6 ...
Thanks So much

"Elton Law" wrote:

Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
...
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Problem in calculating the outcome

Assuming B2:H2 shift range, and B3:H3 hour range, criteria in A10

In B10: =SUMIF($B$2:$H$2,$A10,$B$3:$H$3)

Adjust your range to suit



"Elton Law" wrote:

Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
...
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Problem in calculating the outcome

Try this array formula, entered by pressing Ctrl Shift and Enter
simultaneously which puts the braces round the formula:

{=SUM((B10:H10=3)*(B11:H11))}

"Elton Law" wrote:

Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
...
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Problem in calculating the outcome

Sorry, formula should be {=SUM((B2:H2=4)*(B3:H3))} as in your example and
change the "4" to suit the shift number.

"PJ" wrote:

Try this array formula, entered by pressing Ctrl Shift and Enter
simultaneously which puts the braces round the formula:

{=SUM((B10:H10=3)*(B11:H11))}

"Elton Law" wrote:

Dear Expert,
I have problem in doing a task.
Say below ...
A1 is name. B1 to Z1 is comprised of 25 names ...
A2 is Shifts. There are 12 Shifts in a week.
Even it works, they may have different working hours in a shift.
So, wanna calculate the total hours for shift 4 regarding who did it...
In this case, the answer is 3+4+2=9
For Shift 3, total hours are 2+4=6

Name Jimmy Fiona Cindy Crystal Peter Peggy John
Shifts 1 3 4 2 3 4 4
Hours 3 2 3 4 4 4 2

I cannot use subtotal nor sorting nor marco as order will be distorted.

If only functions are allowed, what can I do please? Hlookup does not help
as search "4", it often stops at Cindy column and the the rest does not work
...
Is there any first Hlookup and Second Hlookup feature?
Real spreadsheet is big as names are 25 ...
Shifts are 12 and not as simple as this one.
But your suggestion can help me to build into my model.

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
varying a cell and seeing the outcome mikebo Excel Worksheet Functions 2 June 22nd 09 07:04 PM
how do I reflect a (-) outcome as 0 mike Excel Worksheet Functions 3 April 2nd 08 12:27 AM
vba outcome harry buggy Excel Worksheet Functions 5 August 29th 07 03:21 PM
vba outcome harry buggy Excel Worksheet Functions 2 August 29th 07 03:18 PM
format the outcome of a formula tinester Excel Discussion (Misc queries) 3 April 12th 06 07:58 PM


All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"