+ Reply to Thread
Results 1 to 9 of 9

Help to create a formula for replace a variable with a number into a cell

  1. #1
    Registered User
    Join Date
    04-18-2020
    Location
    woburn,usa
    MS-Off Ver
    office 2016
    Posts
    4

    Help to create a formula for replace a variable with a number into a cell

    Hi,

    i want to create formula for column C, when the x in column A {"EUR":"x"} take the value of column B
    Attached Files Attached Files
    Last edited by AliGW; 04-19-2020 at 09:14 AM.

  2. #2
    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: Help to create a formula for

    here are various ways...
    =IF(LEFT(RIGHT(A1,3),1)="x",B1,"")
    or
    =IF(MID(A1,9,1)="x",B1,"")
    or
    =IF(ISNUMBER(SEARCH("x",A1))=TRUE,B1,"")
    The first two depend on the format being pretty much the same, the left/right depends on the x always being in three spaces from the right end.
    The mid needs the length to be the same as the format you showed in your workbook.
    The last, isnumber/search will work if the format varies.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

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

    Re: Help to create a formula for

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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

  4. #4
    Registered User
    Join Date
    04-18-2020
    Location
    woburn,usa
    MS-Off Ver
    office 2016
    Posts
    4

    Re: Help to create a formula for replace a variable with a number into a cell

    Hi,

    what i need is to create a formula that replace the variable X in column A with the value in column B and give the result like column C,

    Attached a example,

    best regards
    Attached Files Attached Files

  5. #5
    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: Help to create a formula for replace a variable with a number into a cell

    Thanks for the title update. You did it in the wrong post, though, so I've updated the opening post for you.

    Please see post #2 where a solution is offered.
    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.

  6. #6
    Registered User
    Join Date
    04-18-2020
    Location
    woburn,usa
    MS-Off Ver
    office 2016
    Posts
    4

    Help to create a formula for replace a variable with a number into a cell

    Hi appreciate your reply, maybe in the first post didn't explain well what i needed so i attached a new excel file to explain better what i need.
    in the column C i need a result when the variable X in Cell A1 take the value of the Cell B1,
    i hope you can help me
    best regards
    Attached Files Attached Files

  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: Help to create a formula for replace a variable with a number into a cell

    Maybe this, then?

    =SUBSTITUTE(A1,"x",B1)

  8. #8
    Registered User
    Join Date
    04-18-2020
    Location
    woburn,usa
    MS-Off Ver
    office 2016
    Posts
    4

    Re: Help to create a formula for replace a variable with a number into a cell

    You save me

    thank you

  9. #9
    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: Help to create a formula for replace a variable with a number into a cell

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Formula to create list of items selected for reports (array formula?)
    By Cidona in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-06-2018, 02:09 AM
  2. Replies: 3
    Last Post: 07-05-2017, 04:48 PM
  3. [SOLVED] Can I create a formula and drag the cell and duplicate the formula?
    By attroll in forum Excel General
    Replies: 10
    Last Post: 11-28-2016, 01:14 PM
  4. [SOLVED] VBA to create a relative formula in a conditional format (rather than an absolute formula)
    By The_Snook in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2016, 08:00 AM
  5. Replies: 4
    Last Post: 07-16-2013, 10:32 AM
  6. [SOLVED] I want to create a formula in one sheet, that will function as a formula in other sheets
    By johnw993 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2013, 07:07 PM
  7. Replies: 7
    Last Post: 08-22-2005, 08:05 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