Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tel
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the Annual
Leave column as 8 hours leave (I would then reduce a further total column to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

I'm sure there is a beeter formula for this & somebody willoffer it soon. In
the meantime, this works SO LONG AS your letter codes are all in caps

Put your codes in B1:B6, then put this formula in B1 & copy it down (adjust
the references to N1:N4 to match your data range)

=SUMPRODUCT(--(LEFT($N$1:$N$4,LEN(B2))=B2),IF(NOT(ISERROR(SUBSTI TUTE($N$1:$N$4,B2,"")*1)),SUBSTITUTE($N$1:$N$4,B2, "")*1))



"Tel" wrote:

Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the Annual
Leave column as 8 hours leave (I would then reduce a further total column to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

Sorry, that was supposed to be "put the formula in C1 & copy down"

"Duke Carey" wrote:

I'm sure there is a beeter formula for this & somebody willoffer it soon. In
the meantime, this works SO LONG AS your letter codes are all in caps

Put your codes in B1:B6, then put this formula in B1 & copy it down (adjust
the references to N1:N4 to match your data range)

=SUMPRODUCT(--(LEFT($N$1:$N$4,LEN(B2))=B2),IF(NOT(ISERROR(SUBSTI TUTE($N$1:$N$4,B2,"")*1)),SUBSTITUTE($N$1:$N$4,B2, "")*1))



"Tel" wrote:

Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the Annual
Leave column as 8 hours leave (I would then reduce a further total column to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

Sorry, been a long day & forgot one important thing. This is an array
formula & needs to be entered by pressing Ctrl-Shift-Enter


"Duke Carey" wrote:

I'm sure there is a beeter formula for this & somebody willoffer it soon. In
the meantime, this works SO LONG AS your letter codes are all in caps

Put your codes in B1:B6, then put this formula in B1 & copy it down (adjust
the references to N1:N4 to match your data range)

=SUMPRODUCT(--(LEFT($N$1:$N$4,LEN(B2))=B2),IF(NOT(ISERROR(SUBSTI TUTE($N$1:$N$4,B2,"")*1)),SUBSTITUTE($N$1:$N$4,B2, "")*1))



"Tel" wrote:

Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the Annual
Leave column as 8 hours leave (I would then reduce a further total column to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tel
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

Many thanks Duke,

Tried copying it down but there's some fixed references here so it looks
like I have to manually adjust all the formulae per cell!!! :-) Ho Hum such
is life lol

Terry

"Duke Carey" wrote:

Sorry, been a long day & forgot one important thing. This is an array
formula & needs to be entered by pressing Ctrl-Shift-Enter


"Duke Carey" wrote:

I'm sure there is a beeter formula for this & somebody willoffer it soon. In
the meantime, this works SO LONG AS your letter codes are all in caps

Put your codes in B1:B6, then put this formula in B1 & copy it down (adjust
the references to N1:N4 to match your data range)

=SUMPRODUCT(--(LEFT($N$1:$N$4,LEN(B2))=B2),IF(NOT(ISERROR(SUBSTI TUTE($N$1:$N$4,B2,"")*1)),SUBSTITUTE($N$1:$N$4,B2, "")*1))



"Tel" wrote:

Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the Annual
Leave column as 8 hours leave (I would then reduce a further total column to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Seperating Numbers from Letters in Excel


Tel Wrote:
Any suggestions to improve on this would be most welcome.


I couldn't view your spreadsheet, I got an error but I'd suggest that
it would be much simpler if you put the codes and associated hours in
two adjacent cells - then you could use some less complex and more
easily maintained SUMIF formulas, e.g

SUMIF(A$1:A$10,"AL",B$1:B$10)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=525858

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

I tried to look at your file but I got an error 404: file not found.

Biff

"Tel" wrote in message
...
Many thanks Duke,

Tried copying it down but there's some fixed references here so it looks
like I have to manually adjust all the formulae per cell!!! :-) Ho Hum
such
is life lol

Terry

"Duke Carey" wrote:

Sorry, been a long day & forgot one important thing. This is an array
formula & needs to be entered by pressing Ctrl-Shift-Enter


"Duke Carey" wrote:

I'm sure there is a beeter formula for this & somebody willoffer it
soon. In
the meantime, this works SO LONG AS your letter codes are all in caps

Put your codes in B1:B6, then put this formula in B1 & copy it down
(adjust
the references to N1:N4 to match your data range)

=SUMPRODUCT(--(LEFT($N$1:$N$4,LEN(B2))=B2),IF(NOT(ISERROR(SUBSTI TUTE($N$1:$N$4,B2,"")*1)),SUBSTITUTE($N$1:$N$4,B2, "")*1))



"Tel" wrote:

Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff
hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the
initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the
Annual
Leave column as 8 hours leave (I would then reduce a further total
column to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Seperating Numbers from Letters in Excel

With your data in A2:A11 and the type of absence in B2

=SUMPRODUCT(--(LEFT(SUBSTITUTE($A$2:$A$11,"CA","^^"),LEN(B2))=IF (B2="CA","^^",B2)),--(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBST ITUTE(SUBSTITUTE(0&SUBSTITUTE($A$2:$A$11,"T","")," S",""),"AL",""),"CA","^^"),"C",""),"L",""),"^^","" )))

having said that you should really put the absence in one cell and the hours
on another, assume the type was in A2:A11, the hours in B2:B11 and the
criteria in C2

=SUMIF($A$2:$A$11,C2,$B$2:$B$11)

you could easily extract the numbers from the range by using

=--MID(A2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"012345 6789")),1024)

and copy down






--

Regards,

Peo Sjoblom



"Tel" wrote in message
...
Okay here's a challenge (well it was for me!)

I am creating a staff planner and need to count part-time staff hours.

the data that is entered has two variable
a7.5
a = type of absence;
T = training
S = sick
AL = Annual Leave
L = Lieu time
C = compassionate
CA = Carer's Leave

the number = the number of hours booked off

How do I seperate the two to make an additional column recognise the
initial
letter and then total all occurences of that letter.

e.g. (Cell N11)= "AL5.5" + (Cell N15) = "AL2.5" would show in the Annual
Leave column as 8 hours leave (I would then reduce a further total column
to
by the total)

If you need to view the planner go to www.tbgb.co.uk/plannerv1.xls

Any suggestions to improve on this would be most welcome.

Tel



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
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
Excel won't sort numbers correctly martin0642 Excel Discussion (Misc queries) 2 September 27th 05 05:34 PM
How do i change column headings back to letters in excel? Chris Excel Discussion (Misc queries) 2 April 14th 05 02:10 PM
the letters across the top in excel have changed to numbers why popabear New Users to Excel 1 April 7th 05 11:09 PM
How to convert Excel imported numbers from text to numbers? Alden Excel Discussion (Misc queries) 9 April 1st 05 09:51 PM


All times are GMT +1. The time now is 02:45 AM.

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

About Us

"It's about Microsoft Excel"