Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default sum letters with values and numbers

I have a time sheet that where I want to do various totals. When it's hours
worked, no problem. This department also uses letters (P, V, H) to indicate
time off with pay (personal, vacation, holiday). They would also like to use
the lower case version to indicate half a day. How do a get a sum or sumif
function to see the letters as their numeric equivalent and total them with
the other numbers entered?

I know this is probably overly simple for this site, but I can't find it in
the Help section or I can't phrase the question will enough for Help to find
my answer.

Thanks,
--
WJG
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default sum letters with values and numbers

Since most Excel functions are case insensitive, I think using H for one
thing and h for another is adding a horrid complication,
How about H and HH ?
With this in A1:J1
h , , h, h, , 3, hh, 1, 2, 3
I used =SUM(A1:J1)+COUNTIF(A1:J1,"h")*4+COUNTIF(A1:J1,"hh ")*8'
to get a value of 29:
3+1+2+3 = 9, each h is worth 4 (4*4=12) and each hh is worth 8 (1*8=8)
giving 9+12+8 = 29

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Galadad" wrote in message
...
I have a time sheet that where I want to do various totals. When it's
hours
worked, no problem. This department also uses letters (P, V, H) to
indicate
time off with pay (personal, vacation, holiday). They would also like to
use
the lower case version to indicate half a day. How do a get a sum or
sumif
function to see the letters as their numeric equivalent and total them
with
the other numbers entered?

I know this is probably overly simple for this site, but I can't find it
in
the Help section or I can't phrase the question will enough for Help to
find
my answer.

Thanks,
--
WJG


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default sum letters with values and numbers

On Mon, 11 Jan 2010 15:57:04 -0400, "Bernard Liengme"
wrote:

Since most Excel functions are case insensitive, I think using H for one
thing and h for another is adding a horrid complication,
How about H and HH ?
With this in A1:J1
h , , h, h, , 3, hh, 1, 2, 3
I used =SUM(A1:J1)+COUNTIF(A1:J1,"h")*4+COUNTIF(A1:J1,"hh ")*8'
to get a value of 29:
3+1+2+3 = 9, each h is worth 4 (4*4=12) and each hh is worth 8 (1*8=8)
giving 9+12+8 = 29

best wishes


With the example input, but with H instead of hh, here is an
alternative formula that gives the same result, ie 29:

=SUM(IF(A1:J1="",0,IF(ISNUMBER(A1:J1),A1:J1,CHOOSE (FIND(A1:J1,"hHXxZzY"),4,8,10,20,30,40,50))))

Note: This is an array formula that has to be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

The XxZzY and ,10,20,30,40,50 is just to indicate that you can add
more letter codes with there corresponding "values" to this example.
So if you have many single letter codes to handle, CHOOSE can handle
254 values, this formula might be a little shorter.

Hope this helps / Lars-Åke
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
Count only Letters in cells that contain both letters and numbers TommyB Excel Worksheet Functions 2 August 8th 09 12:29 AM
Finding most common occurence of values in cells containing letters and numbers sparklyballs Excel Worksheet Functions 2 August 18th 06 12:16 PM
Sorting - cells containing numbers, numbers and letters Gunny Excel Discussion (Misc queries) 5 July 16th 06 01:22 AM
Numbers to Letters? PaulW Excel Discussion (Misc queries) 2 May 26th 06 12:19 PM
create self-generating numbers with letters and numbers cxlough41 Excel Discussion (Misc queries) 11 January 4th 06 01:16 AM


All times are GMT +1. The time now is 05:58 PM.

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"