LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default separate cell values with formulas - can this be improved?

OK, bear with me because this is kind of obfuscated.

I am working with a monthly invoice. On the invoice, we have Period
Start and Period End date. These will usually be first and last of
the month. We are billing for a service whose rate varies based on
whether it is a weekend or a weekday. We receive information from
service department regarding which days services were not performed,
and list them on the invoice.

Here's an example (without the " "s):

(stored as dates)
B22 = July 1, 2007
D22 = July 31, 2007
(text entries)
E22 = "(Off on July "
F22 = "1,2,3,6,9,10,12,15 = 8 days)"

Now, we need to adjust number of billable days based on whether each
day is a weekday or a weekend.

In cells J1:J31, i have this formula: =MID($F
$22,IFERROR(FIND(CHAR(150),SUBSTITUTE($F$22,",",CH AR(150),ROW()-1))
+1,1),FIND(CHAR(150),SUBSTITUTE($F$22,",",CHAR(150 ),ROW()))-
IFERROR(FIND(CHAR(150),SUBSTITUTE($F$22,",",CHAR(1 50),ROW()-1))+1,1))

This extracts each number (1,2,3,6,9,10,12,15). Now, in the main
portion of the invoice I have these two array formulas:

=NETWORKDAYS(B22,D22)-SUM(IFERROR(--
(WEEKDAY(DATE(YEAR(B22),MONTH(B22),J1:J31),2)<6)," "))&" Weekdays
(10hrs per day)"

and

=(D22-B22)+1-NETWORKDAYS(B22,D22)-SUM(IFERROR(--
(WEEKDAY(DATE(YEAR(B22),MONTH(B22),J1:J31),2)5)," "))&" Weekends
(16hrs per day)"

My question is: can I do this somehow without using the helper column
(J)? I couldn't think of another way to find each subsequent comma,
perhaps there is a more clever way of using the SUBSTITUTE function?

I would like this to be a template that anyone can use, and have to do
nothing besides fill in the two dates and the non-service days. While
it's not a problem hiding the J column, there's still a chance it
might get deleted or rows inserted to screw up the calculation.

 
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
Insert a value in a cell based upon a comparison of cell values in 2 separate worksheets Doctorjones_md Excel Discussion (Misc queries) 7 June 8th 07 09:32 PM
Insert a value in a cell based upon a comparison of cell values in 2 separate worksheets Doctorjones_md Excel Worksheet Functions 7 June 8th 07 09:32 PM
Separate values in cell by delimiter JR Excel Discussion (Misc queries) 13 February 6th 07 05:56 PM
find a cell matching separate column and row values LQEngineer Excel Worksheet Functions 2 July 26th 06 07:10 AM
Copy cell values across separate sheets claytorm Excel Discussion (Misc queries) 3 June 27th 05 10:03 PM


All times are GMT +1. The time now is 06:43 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"