Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5846529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:35:22+00:00 2026-05-22T12:35:22+00:00

I have a string mentioned below and I need to return the results in

  • 0

I have a string mentioned below and I need to return the results in 2 separate columns

Column 1: Count all the locations separating by Semicolon. for the below example, there are total of 15 names which are joined with semicolon

Column 2: After this I need to count how many names START with A, B & C and how many do not.

A1604A;A3703E;A3703H;C2203H;F1001B;F1001C;F1001D;F1001E;F1001F;F1001G;F1001H;F1001J;F1001K;F1001L;F1001M
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:35:23+00:00Added an answer on May 22, 2026 at 12:35 pm

    Iterate the split array incrementing a counter array for A,B,C,Other;

    Dim str     As String: str = "A123;A456;B111;C222;C333;ZXX;Y66"
    Dim items() As String
    Dim i       As Long
    Dim pfx(3)  As Long
    Dim key     As Long
    
    items = Split(str, ";")
    
    For i = 0 To UBound(items)
        Select Case Left(items(i), 1)
            Case "A", "B", "C"
                key = Asc(Left(items(i), 1)) - 65 '//convert to 0,1,2 for counter index
            Case Else
                key = 3
        End Select
        pfx(key) = pfx(key) + 1
    Next
    
    Range("A1").Value = "total: " & UBound(items) + 1
    Range("B1").Value = "A total: " & pfx(0)
    Range("C1").Value = "B total: " & pfx(1)
    Range("D1").Value = "C total: " & pfx(2)
    Range("E1").Value = "Other total: " & pfx(3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string as mentioned below: $ts = 3/11/09 11:18:59 AM; which I
i have the following string: http://pastebin.com/d29ae565b i need to separate each value and put
I have string like this: G:\Projects\TestApp\TestWeb\Files\Upload\file.jpg How can I remove all text before Files
I have string column with numbers in a datagridview.It is not bound, I would
Let's say we have a property as below public string SomeProperty { get {
As mentioned below I have made changes to the code which looks like following
I have string like this /c SomeText\MoreText Some Text\More Text\Lol SomeText I want to
I have string that I want to chop to array of substrings of given
I have string like \LESSING\root\cimv2:Win32_UserAccount.Domain=LESSING,Name=Admin How to convert it to LESSING\Admin using Framework?
i have string stored in python variables, and i am outputting a html that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.