+ Reply to Thread
Results 1 to 12 of 12

Formula for last 3 characters

  1. #1
    Registered User
    Join Date
    02-04-2021
    Location
    philadelphia
    MS-Off Ver
    2018
    Posts
    6

    Formula for last 3 characters

    looking to write a formula to sum a total of range based on the last three digits of an account number?

    Thanks


    Excel Question 1.JPG

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Formula for last 3 characters

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-04-2021
    Location
    philadelphia
    MS-Off Ver
    2018
    Posts
    6

    Re: Formula for last 3 characters

    It does, thank you.

  4. #4
    Registered User
    Join Date
    02-04-2021
    Location
    philadelphia
    MS-Off Ver
    2018
    Posts
    6

    Re: Formula for last 3 characters

    looking to sum based on the last 3 characters in Column A. Please let me know
    Attached Files Attached Files

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Formula for last 3 characters

    how about this... =SUMIF(A:A,"*011",C:C)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Registered User
    Join Date
    02-04-2021
    Location
    philadelphia
    MS-Off Ver
    2018
    Posts
    6

    Re: Formula for last 3 characters

    Wow, looks like I made it far more complicated then it needed to be. Thanks

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Formula for last 3 characters

    This will also work if you just want to point it at a cell instead of hard coding it...
    =SUMIF(A:A,"*"&F3,C:C)

    AND, thank you for the rep!
    Last edited by Sam Capricci; 02-04-2021 at 11:30 PM.

  8. #8
    Registered User
    Join Date
    02-04-2021
    Location
    philadelphia
    MS-Off Ver
    2018
    Posts
    6

    Re: Formula for last 3 characters

    What does the middle part represent? "*11" Say I wanted to do the first 3 numbers? Would I need to change anything besides the actual numbers I am looking for? or just write it "*497"

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Formula for last 3 characters

    for first three digits

    =SUMIF(A:A,"497*",C:C)
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Formula for last 3 characters

    Middle part:

    "*11*" : 11 is in middle

    or

    "??11?" (hardcode "2 digits&11&1 digit"

    "*11" 11 is from the right

    "11*" 11 is from the left
    Quang PT

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Formula for last 3 characters

    with power query

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    Column1 Column2 Salary Sum
    2
    010 Accounting/Admin
    5001191.26
    3
    011 Dispatch
    2147094.3
    4
    052 HH Customer Service
    781140.1
    5
    012 Safety
    119999.88
    6
    050 Sales
    1391985.92
    7
    015 Driver Support
    69999.8
    8
    016 HH Claims
    48500.14
    9
    017 Fleet Admin
    34320
    10
    018 Training
    11
    020 EL Trailer Drivers
    3152142.24
    12
    021 EL S/T Drivers
    1286836.98
    13
    051 Customer Service
    1100064.16
    14
    022 EL Trailer Drivers
    52000
    15
    055 Information Technology
    764404.16
    16
    023 HH S/T Drivers
    17
    027 Telecobuy Dedicated Trailer Drivers
    147680
    18
    046 EL Warehouse
    3759856.88
    19
    030 EL Helpers
    294112
    20
    031 HH Helpers
    178880
    21
    032 EL Summer Helpers
    22
    033 HH Summer Helpers
    23
    035 Corporate Facilities
    395047.9
    24
    039 LF Installer
    1838184.4
    25
    040 HH Warehouse
    141398.4
    26
    045 P/T Warehouse
    101836.8
    27
    048 EL Warehouse(Chicago)
    391560
    28
    056 Billing
    335484.76
    29
    053 Marketing
    30
    054 MTS Protection One
    31
    057 TAG TONNAGEACCEPTANCEGROUP
    32
    058 Business Development
    149999.98
    33
    060 Shop
    265760.3
    Sheet: Merge1

    Mcode to sum by account type

    Please Login or Register  to view this content.
    Mcode to merge the tables

    Please Login or Register  to view this content.


    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files

  12. #12
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Formula for last 3 characters

    The asterisk "*" acts as a wild card. Put before the 011 like "*011" means that it will look for everything with a 011 ending and whatever to the left of it.
    Same for the right, "011*" would act as a wild card looking for everything that starts with a 011...
    Hope that helps.

+ 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] Search string for specific characters, then output characters that reflect range
    By jackmaca in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-19-2020, 09:13 AM
  2. [SOLVED] Remove characters from cells if the have non data and characters as per attached sheet
    By khanaran in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-17-2019, 02:35 PM
  3. VBA Characters() Function Fails when the Cell Content Exceeds 261 Characters
    By :) Sixthsense :) in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-07-2016, 06:37 AM
  4. Replies: 2
    Last Post: 02-09-2016, 11:00 AM
  5. [SOLVED] VBA, remove all characters within a string, except numerical characters and full stops
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2015, 09:24 PM
  6. Replies: 11
    Last Post: 01-23-2013, 02:04 PM
  7. [SOLVED] Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characters
    By VBA_Gary in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2012, 12:09 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