+ Reply to Thread
Results 1 to 7 of 7

RIGHT function

  1. #1
    Registered User
    Join Date
    08-28-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    26

    RIGHT function

    Hi there

    In my spreadsheet, I import a block of text from an external source (not Excel) into (in Example 1), column N. I automatically capture the order value shown in the text by using the RIGHT function a couple of columns along. =RIGHT(N138,5)

    I have set this to 5 digits, as most of the values are this (for example, £75.80... £79.99... £71.98 and so on). On a few occasions, the order value exceeds this and requires 6 digits (for example, £220.98... £354.25... £256.66 and so on). =RIGHT(R138,6)

    Is there a better way to express the formula so that it can capture the last 5 digits if it's 5... and/or the last 6 digits if it's 6 - meaning that I don't have to manually check and correct these few anomalies?

    Many thanks
    Terri

  2. #2
    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,916

    Re: RIGHT function

    Try this:

    =MID(A1,FIND("£",A1)+1,99)

    EDIT: Sorry, that won't work. Let me think again!
    Last edited by AliGW; 08-01-2020 at 05:44 AM.
    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.

  3. #3
    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,916

    Re: RIGHT function

    Try this:

    =TRIM(RIGHT(SUBSTITUTE(A1,"£",REPT(" ",99)),99))

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: RIGHT function

    Please try

    =-LOOKUP(0,-RIGHT(L6,{5,6}))

    or

    =-LOOKUP(0,-RIGHT(L6,{3,4,5,6,7}))
    to cover more digit

  5. #5
    Registered User
    Join Date
    08-28-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: RIGHT function

    Hi AliGW

    That's perfect! Thank you!

    Regards
    Terri

  6. #6
    Registered User
    Join Date
    08-28-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: RIGHT function

    Thank you so much, but have now resolved this!

  7. #7
    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,916

    Re: RIGHT function

    You're welcome.

+ 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. Right function, Left function, Mid function to extract values in column A
    By bjnockle in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-14-2020, 03:14 PM
  2. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  3. [SOLVED] Usage of standard functions into custom function (or user defined function)
    By tusharb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2016, 12:43 AM
  4. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  5. VBA code for custom function that returns detail results of array function
    By onechipshot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2015, 06:30 PM
  6. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  7. Replies: 1
    Last Post: 03-21-2012, 11:22 AM

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