Count the non-numeric value starting with "T" based on specific date

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
360
Office Version
  1. 365
Platform
  1. Windows
i have a long range of dates.. i want to count all the non-numeric values starting with the latest "T" upto specific date (Q2).
However the count is zero if the specific date is "T" followed by a numeric value or a numeric value.. see below



Book2
ABCDEFGHIJKLMNOPQR
1
205-03-25
3
401-03-2502-03-2503-03-2504-03-2505-03-2506-03-2507-03-2508-03-2509-03-2510-03-2511-03-2512-03-2513-03-2514-03-2515-03-25Expected Result
58TVFT88888TSVFE0Since March 5 is T and followed by numeric values
666TFEFSTFFEFSVX3Starting March 3 "T" to March 5
78TSFFEFSVVFETSV4Starting March 2 "T" to March 5
8888TEFEFSVTEFSV2Starting March 4 "T" to March 5
9888888TFSVTEFSV0Since March 5 numeric values
108888TZFFSVTEFSV1Since March 5 is "T" followed by non-numeric values
Sheet2
 
try, In P5 copied down
Excel Formula:
=LET(dt,$A$5:$O$10,a,MATCH($Q$2,$A$4:$O$4,0),ip,A5:INDEX(A5:O5,a),b,MAX(("T"=ip)*COLUMN(ip)),c,IF(b<a,SUM(1*(ISTEXT(INDEX(ip,b):INDEX(ip,a)))),IF(b=a,1*ISTEXT(INDEX(dt,ROWS($P$5:$P5),a+1)),1)),c)
 
Last edited:
Upvote 0
try, In P5 copied down
Excel Formula:
=LET(dt,$A$5:$O$10,a,MATCH($Q$2,$A$4:$O$4,0),ip,A5:INDEX(A5:O5,a),b,MAX(("T"=ip)*COLUMN(ip)),c,IF(b<a,SUM(1*(ISTEXT(INDEX(ip,b):INDEX(ip,a)))),IF(b=a,1*ISTEXT(INDEX(dt,ROWS($P$5:$P5),a+1)),1)),c)
thanks man, really appreciate..
it works on March 5.. but when i switch the date March 9, the first row should return to zero.. if its numeric value or "T" followed by number it should be zero..
1742472955925.png
 
Upvote 0
Here's another option:
Excel Formula:
=LET(fr,FILTER(A5:O5,$A$4:$O$4<=$Q$2+1),a,--ISTEXT(DROP(fr,,XMATCH("T",fr,,-1))),IF(TAKE(a,,1)=0,0,SUM(a)))
 
Upvote 0
hhhhhh.xlsx
ABCDEFGHIJKLMNOPQR
1
23/5/2025
3
43/1/20253/2/20253/3/20253/4/20253/5/20253/6/20253/7/20253/8/20253/9/20253/10/20253/11/20253/12/20253/13/20253/14/20253/15/2025Expected Result
58TVFT88888TSVFE0Since March 5 is T and followed by numeric values
666TFEFSTFFEFSVX3Starting March 3 "T" to March 5
78TSFFEFSVVFETSV4Starting March 2 "T" to March 5
8888TEFEFSVTEFSV2Starting March 4 "T" to March 5
9888888TFSVTEFSV0Since March 5 numeric values
108888TZFFSVTEFSV1Since March 5 is "T" followed by non-numeric values
Sheet1
Cell Formulas
RangeFormula
Q5:Q10Q5=IF((SUM(($A5:$O5="T")*($A$4:$O$4<=$Q$2))=0)+(SUM(($A$4:$O$4=$Q$2+1)*ISNUMBER($A5:$O5))=1)<>0,0,$Q$2-MAX($A$4:$O$4*($A5:$O5="T")*($A$4:$O$4<=$Q$2))+1)
 
Upvote 0
S5:S10=
Excel Formula:
IF(MAX(SUM(($A$4:$O$4=$Q$2+1)*ISNUMBER($A5:$O5))*($A$4:$O$4=$Q$2)*($A5:$O5="T")),"Since March 5 is T and followed by numeric values",IF(MAX(SUM(($A$4:$O$4=$Q$2+1)*ISTEXT($A5:$O5))*($A$4:$O$4=$Q$2)*($A5:$O5="T")),"Since March 5 is ""T"" followed by non-numeric values",IF(MAX(($A5:$O5="T")*($A$4:$O$4<$Q$2)),"Starting March 3 ""T"" to "&TEXT(INDEX($A$4:$O$4,MAX((COLUMN($A$4:$O$4)-COLUMN($A$4)+1)*(($A5:$O5="T")*($A$4:$O$4<$Q$2)))),"mmm dd"),IF(MAX(ISNUMBER($A5:$O5)*($A$4:$O$4=$Q$2))=1,TEXT(INDEX($A$4:$O$4,1,MAX((COLUMN($A$4:$O$4)-COLUMN($A$4)+1)*(($A5:$O5<>"T")*($A$4:$O$4=$Q$2)))),"mmm dd")&"numeric values"))))
 
Upvote 0
Here's another option:
Excel Formula:
=LET(fr,FILTER(A5:O5,$A$4:$O$4<=$Q$2+1),a,--ISTEXT(DROP(fr,,XMATCH("T",fr,,-1))),IF(TAKE(a,,1)=0,0,SUM(a)))
thank you.. really appreciate the effort..
when i change the date to March 10 rows 8 to 10 counted as zero. it appears it returns 0 if the next day (March 11) is a "T"..

1742535478064.png
 
Upvote 0
hhhhhh.xlsx
ABCDEFGHIJKLMNOPQR
1
23/5/2025
3
43/1/20253/2/20253/3/20253/4/20253/5/20253/6/20253/7/20253/8/20253/9/20253/10/20253/11/20253/12/20253/13/20253/14/20253/15/2025Expected Result
58TVFT88888TSVFE0Since March 5 is T and followed by numeric values
666TFEFSTFFEFSVX3Starting March 3 "T" to March 5
78TSFFEFSVVFETSV4Starting March 2 "T" to March 5
8888TEFEFSVTEFSV2Starting March 4 "T" to March 5
9888888TFSVTEFSV0Since March 5 numeric values
108888TZFFSVTEFSV1Since March 5 is "T" followed by non-numeric values
Sheet1
Cell Formulas
RangeFormula
Q5:Q10Q5=IF((SUM(($A5:$O5="T")*($A$4:$O$4<=$Q$2))=0)+(SUM(($A$4:$O$4=$Q$2+1)*ISNUMBER($A5:$O5))=1)<>0,0,$Q$2-MAX($A$4:$O$4*($A5:$O5="T")*($A$4:$O$4<=$Q$2))+1)
thanks.. when i change the date to March 10, range A5:O5 counted as 6 it should be zero because cell J5 is a numeric value..
1742536018856.png
 
Upvote 0
How about this option:
Excel Formula:
=LET(fr,FILTER(A5:O5,$A$4:$O$4<=$Q$2+1),c,IF(TAKE(fr,,-1)="T",HSTACK(DROP(fr,,-1),"E"),fr),a,--ISTEXT(DROP(c,,XMATCH("T",c,,-1))),IF(TAKE(a,,1)=0,0,SUM(a)))
 
Upvote 0
Solution
Try. In P5 copied down
Excel Formula:
=LET(dt,$A$5:$O$10,a,MATCH($Q$2,$A$4:$O$4,0),ip,A5:INDEX(A5:O5,a),b,MAX(("T"=ip)*COLUMN(ip)),c,IF(b<a,SUM(1*(ISTEXT(INDEX(ip,b+1):INDEX(dt,ROWS($P$5:$P5),a+1)))),IF(b=a,1*ISTEXT(INDEX(dt,ROWS($P$5:$P5),a+1)),1)),c)
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top