+ Reply to Thread
Results 1 to 4 of 4

Index or Last Occurrence Formula

  1. #1
    Registered User
    Join Date
    04-26-2022
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    18
    Posts
    3

    Index or Last Occurrence Formula

    Hello,

    This is my first post, I hope I am doing this correctly and I hope this is not written in a too confusing way. I am using excel to help setup syntax for IBM SPSS and need to know how to find the last occurrence of a string that has a slight change at the end of every cell. Ultimately the SPSS syntax should look like below using the QS2 set which as 16 sub variables.

    HTML Code: 

    My issue is every set of questions has a different number of variables and I only need the 1st and last occurrence of a set (ie.Q2S.1 to QS2.16 whereas the QS3 series only has 11 so it would be Q3S.1 to QS2.11).

    Attached is a sample workbook I have started to set up, any assistance would be greatly appreciated, I believe it is an index formula that I need but I am not sure...
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Index or Last Occurrence Formula

    This ??

    in I3

    ="count "&$H$3&"="&LEFT(A3,4)&"1"&" to "&COUNTIF(A:A,LEFT(A3,3)&"*")&"("&G3&")"

    Highlighted will need to be changed for QSxx i.e QS10 onwards
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    04-26-2022
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    18
    Posts
    3

    Re: Index or Last Occurrence Formula

    Thank you! It worked great

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Index or Last Occurrence Formula

    Administrative Note:

    Members will tailor the solutions they offer to the version (NOT release number) of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Index Match only after Occurrence of specific text
    By Dendrinos2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-22-2022, 03:38 AM
  2. INDEX/MATCH single occurrence
    By donjamin in forum Excel General
    Replies: 1
    Last Post: 10-27-2021, 08:52 AM
  3. Replies: 16
    Last Post: 08-19-2019, 08:00 AM
  4. nth occurrence with multiple criteria (index/match)
    By Hlech989 in forum Excel General
    Replies: 3
    Last Post: 03-08-2019, 03:46 AM
  5. Finding Second Occurrence if Index Match Returns -
    By zmster2033 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-22-2016, 02:50 PM
  6. Using index and match to return a value based on earliest occurrence (MONTH)
    By potatoman in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-09-2014, 06:12 AM
  7. [SOLVED] Index Match row value and nth occurrence of header
    By dm@stams in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-22-2013, 05:43 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