+ Reply to Thread
Results 1 to 7 of 7

How return substring of count for override for found december etc?

  1. #1
    Registered User
    Join Date
    01-08-2020
    Location
    Rochester, NY
    MS-Off Ver
    Office 16
    Posts
    11

    How return substring of count for override for found december etc?

    I don't think I ever posted here, so hopefully all is good.

    I have a spreadsheet that will always return varying row contents. So I need to search each row to find the january, february, march, april, may, june, july, etc content and extract the counts from that in the cell with substring. I'm not certain how to do this since the location in the row will always vary. Any ideas? I was thinking vlookup or index or match, or mid/search, but I'm not sure.

    Example spreadsheet content, notice some rows have the overallCount and some have overrideCount, and a string like "overallCount 2022/12 35" is the complete cell value, where 2022 is the year, and 12 is the month:

    (I'm not sure how to get the rows to line up here)

    Please Login or Register  to view this content.
    And the rows can have varying column numbers as well if there are more or less orders for each device.

    I want to add a formula in result8 column or so, and search to the left of each row, and pull out the counts in columns for Jan, Feb, March, April, May, etc. I was thinking of something like this:

    Please Login or Register  to view this content.
    but it's not returning the count. It's returning #N/A

    example per-row output on the right:

    Please Login or Register  to view this content.
    As you can see, not every month has a count that would be found in the row.
    How would I pull those monthly counts for overall and override out to the right in each row?
    Last edited by mcleary1; 01-12-2023 at 10:22 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: How return substring of count for override for found december etc?

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    01-08-2020
    Location
    Rochester, NY
    MS-Off Ver
    Office 16
    Posts
    11

    Re: How return substring of count for override for found december etc?

    | result1 | result2 | result3 | result4 | result5 | Output to right here Overall Jan2022 | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Override Jan2023 | Override Jan2022 | Feb |
    |-------------------------|-------------------------|--------------------------|-------------------------|------------------------|--------------------------------------|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|------------------|------------------|-----|
    | overallCount 2023/01 11 | overallCount 2022/12 35 | overallCount 2022/01 12 | overrideCount 2022/01 5 | | | | | | | | | | | | | 35 | 11 | 5 | |
    | overallCount 2023/02 1 | overallCount 2022/11 34 | overrideCount 2022/02 9 | overrideCount 2022/01 5 | | | | | | | | | | | | 34 | | | 5 | 9 |
    | ------ | (3 rows) | OverrideYearOrders | overrideCount 2022/10 2 | overallCount 2023/01 6 | 6 | | | | | | | | | | | | | | |

  4. #4
    Registered User
    Join Date
    01-08-2020
    Location
    Rochester, NY
    MS-Off Ver
    Office 16
    Posts
    11

    Re: How return substring of count for override for found december etc?

    see attachment. The part from Jan to the right is example of what the formula should return.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-08-2020
    Location
    Rochester, NY
    MS-Off Ver
    Office 16
    Posts
    11

    Re: How return substring of count for override for found december etc?

    see attached

  6. #6
    Registered User
    Join Date
    01-08-2020
    Location
    Rochester, NY
    MS-Off Ver
    Office 16
    Posts
    11

    Re: How return substring of count for override for found december etc?

    On Stackoverflow (it won't let me post link),

    the formula suggestion was

    =SUMPRODUCT(IFERROR(SEARCH(TEXT(AD$5,"yyyy/mm"),$A6:$AA6)>0,FALSE)*IFERROR(RIGHT($A6:$AA6,LEN($A6:$AA6)-(FIND(TEXT(AD$5,"yyyy/mm"),$A6:$AA6)+7)),0))

    But this didn't seem to include override and overall categories, so I'm not sure how to change that.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-08-2020
    Location
    Rochester, NY
    MS-Off Ver
    Office 16
    Posts
    11

    Re: How return substring of count for override for found december etc?

    Answer:

    =IF(SUMPRODUCT(--IFERROR(SEARCH("overallCount "&TEXT(AO$5,"yyyy/mm"),$J6:$AA6)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($J6:$AA6,LEN($J6:$AA6)-(FIND("overallCount "&TEXT(AO$5,"yyyy/mm"),$J6:$AA6)+20)),0)))>0,SUMPRODUCT(--IFERROR(SEARCH("overallCount "&TEXT(AO$5,"yyyy/mm"),$J6:$AA6)>0,FALSE)*SUMPRODUCT(--IFERROR(RIGHT($J6:$AA6,LEN($J6:$AA6)-(FIND("overallCount "&TEXT(AO$5,"yyyy/mm"),$J6:$AA6)+20)),0))),"")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If today's date = December, it will automatically subtract December - November
    By thematrix05 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-04-2022, 05:20 PM
  2. [SOLVED] Find substring in range and categorise cells in range based on substring found
    By Stavrosis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2020, 11:50 AM
  3. Replies: 1
    Last Post: 09-26-2017, 12:05 PM
  4. How to search substring against row and if duplicates found, remove them?
    By joshman10888 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2016, 10:00 PM
  5. Macro to search cells for substring and replace contents of cell if substring is found
    By robbyvegas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2015, 06:40 AM
  6. Search substring within range, report the substring found
    By Brooke1578 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2012, 03:56 PM
  7. Splitting a row into two when a certain substring is found
    By lifeseeker1019 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2011, 11:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1