Function Help (1 Viewer)

mib1019

Member
Local time
Today, 07:27
Joined
Jun 19, 2020
Messages
88
Hello all,

I've got a spreadsheet organized roughly like this. Many more rows and 13 sets of columns(plus two total columns) for 2021-Q1 Weeks.
I need a formula for counting dates (they are in text format) across the rows at Date Count, and by row where dates are entered with comma separators (see below, bolded cells)

Hope you can help me here. I'm a bit under the gun to get this to my person tomorrow. :\

Thanks, MIB1019

ProgramWK1 DatesWK1 CostWK2 DatesWK2 CostWK3 DatesWK3 CostDate CountTotal Cost
Program 128,30,1$15005,7$100011,13,15$1500Count dates in all Dates columns (8)Sum of dollar columns
Program 229,31$10004,6,8$150012,14,16$1500Count dates in all Dates columns (8)Sum of dollar columns
Program 328,29,30,31,1$25004,5,6,7,8$250011,12,13,14,15$2500Count dates in all Dates columns (15)Sum of dollar columns
TOTALSCount 'dates' trimming '," (10)Sum FunctionCount 'dates' trimming ',"
(10)
Sum FunctionCount 'dates' trimming ',"
(11)
Sum FunctionSum of date count rows (31)Sum Total Cost
 

namliam

The Mailman - AWF VIP
Local time
Today, 15:27
Joined
Aug 11, 2003
Messages
11,695
I have a dutch version but this will do the trick:
Code:
=LENGTE( 
  SUBSTITUEREN(
   SUBSTITUEREN(
    SUBSTITUEREN(
     SUBSTITUEREN( 
      SUBSTITUEREN(
       SUBSTITUEREN(
        SUBSTITUEREN(
         SUBSTITUEREN(
          SUBSTITUEREN(
           SUBSTITUEREN(A1
                  ;0;"")
                 ;1;"")
                ;2;"")
               ;3;"")
              ;4;"")
             ;5;"")
            ;6;"")
           ;7;"")
          ;8;"") 
         ;9;"")
        )+1
I think Lengte in the English versions is Len (or Length) and Substitueren is REPLACE.
Rince repeat replacing A1 for the cells you want to count.

I hope this helps you get rid of the gun :)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:27
Joined
Aug 30, 2003
Messages
36,124
Simpler I think:

=LEN(F11)-LEN(SUBSTITUTE(F11,",",""))+1

F11 being the cell containing the date string in my test.
 

mib1019

Member
Local time
Today, 07:27
Joined
Jun 19, 2020
Messages
88
Thanks you guys! That works per cell. Without adding columns (and hiding them) to do a sum of the counts, any ideas?
 

Isaac

Lifelong Learner
Local time
Today, 06:27
Joined
Mar 14, 2017
Messages
8,774
Thanks you guys! That works per cell. Without adding columns (and hiding them) to do a sum of the counts, any ideas?
What do you mean by that? What Paul gave you should be all you need. Sum it where desired. If you have a further question can you upload a spreadsheet and place the desired result in the cell where you have the question:?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:27
Joined
Aug 30, 2003
Messages
36,124
Simplest is probably this type of thing:

=(LEN(F11)-LEN(SUBSTITUTE(F11,",",""))+1) + (LEN(F12)-LEN(SUBSTITUTE(F12,",",""))+1) + (LEN(F13)-LEN(SUBSTITUTE(F13,",",""))+1)
 

namliam

The Mailman - AWF VIP
Local time
Today, 15:27
Joined
Aug 11, 2003
Messages
11,695
Simpler I think:

=LEN(F11)-LEN(SUBSTITUTE(F11,",",""))+1

F11 being the cell containing the date string in my test.
Is the reverse and sure looks simpeler :)
 

namliam

The Mailman - AWF VIP
Local time
Today, 15:27
Joined
Aug 11, 2003
Messages
11,695
Thanks you guys! That works per cell. Without adding columns (and hiding them) to do a sum of the counts, any ideas?
The formula, ok, takes some creativity, but this seriously?
 

mib1019

Member
Local time
Today, 07:27
Joined
Jun 19, 2020
Messages
88
Thank you all for the help. Nevermind my second question. Your formula(s) are all that I need.

You all rock!
MIB1019
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:27
Joined
Aug 30, 2003
Messages
36,124
Glad you got it working.
 

Users who are viewing this thread

Top Bottom