+ Reply to Thread
Results 1 to 12 of 12

writing a formula in a cell to perform a function using the output from another formula

  1. #1
    Registered User
    Join Date
    12-29-2020
    Location
    US, MS
    MS-Off Ver
    10 I think
    Posts
    6

    writing a formula in a cell to perform a function using the output from another formula

    Sorry, I'm sorta new to excel other than simple data spreadsheets. I know how to simply sum/product multiple cells etc. However, I'm trying to make a product that performs multiple steps that give you a numeric outcome. One of those steps involves a substitution of a number for certain letters that are entered in a cell. Then I need to take the resulting number that is substituted for a letter and involve it in a simple sum with another cell. My question is how to do that? If I try to sum the cell with the substituted number in it it doesn't work because of the formula in the cell.

    Thanks
    Attached Files Attached Files
    Last edited by ilikec4chrisp; 12-29-2020 at 11:50 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,376

    Re: writing a formula in a cell to perform a function using the output from another formul

    See the yellow banner at the top of the page.

    For those of us using iPads, please include the formula(e) in the thread.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-29-2020
    Location
    US, MS
    MS-Off Ver
    10 I think
    Posts
    6

    Re: writing a formula in a cell to perform a function using the output from another formul

    Please see example

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

    Re: writing a formula in a cell to perform a function using the output from another formul

    27 subtitute are not good solution! Also it returns "4" (text) not 4 (value)

    Try another approach:

    Please Login or Register  to view this content.
    Then in A7:

    =A2+A3+A5
    Quang PT

  5. #5
    Registered User
    Join Date
    12-29-2020
    Location
    US, MS
    MS-Off Ver
    10 I think
    Posts
    6

    Re: writing a formula in a cell to perform a function using the output from another formul

    OMG thank you! This works but I just realized that it creates another problem. I basically wrote the formula for A7 wrong. I need it to multiply actually, but can you do selective multiplication:

    A5 * either A2 or A3 based on which one has an entry in it, ignoring one if its blank.

    The function is to check a number that may contain a letter or a number in the first or second position. So the number being checked could be AE123 or 12345. In the case of a letter in the first or second position that's where the "substitution" or now "match" comes in in cell A2. If the first character is a number then A7 simply gets the product of A3 and A5.

    I apologize if this is confusing and thanks for your help.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: writing a formula in a cell to perform a function using the output from another formul

    Couldn't you replace that match formula with SEARCH/FIND?
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    12-29-2020
    Location
    US, MS
    MS-Off Ver
    10 I think
    Posts
    6

    Re: writing a formula in a cell to perform a function using the output from another formul

    I'm trying to figure out how to do that. Is that something you write into the spreadsheet so that whenever that value is input it is changed to the desired value. Or is it a tool for one user to search, find and change a selected value per use?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: writing a formula in a cell to perform a function using the output from another formul

    The MATCH part of the formula bebo021999 posted essentially finds the position of the value in A1 in the array that's passed as the second argument.

    Since all the values in that array are unique you could convert the array to a string and do the same thing using FIND or search.

    The formula would look something like this - can't post the entire formula as the board security doesn't like the less than sign in the data, it thinks it's an HTML tag opening character.

    SEARCH(A1, "AKU")

    Obviously you would replace AKU with a string containing all the characters of interest in the correct order.

  9. #9
    Registered User
    Join Date
    12-29-2020
    Location
    US, MS
    MS-Off Ver
    10 I think
    Posts
    6

    Re: writing a formula in a cell to perform a function using the output from another formul

    I've got some more studying to try to figure out how this match formula would work with what I'm attempting. It may provide another route to get to where I need to go. As of now everything works except being able to write something that gives me a selective product between one cell that has a constant number in it and one of two cells based on which one is used/has an entry put into it.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: writing a formula in a cell to perform a function using the output from another formul

    A5 * either A2 or A3 based on which one has an entry in it, ignoring one if its blank.
    Assuming that either A2 or A3 will always be blank, try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  11. #11
    Registered User
    Join Date
    12-29-2020
    Location
    US, MS
    MS-Off Ver
    10 I think
    Posts
    6

    Re: writing a formula in a cell to perform a function using the output from another formul

    Wow! Thank you so much. This works! Problem solved, thank you for your help everyone who contributed.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: writing a formula in a cell to perform a function using the output from another formul

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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] Writing the Output of Function to sheet2
    By deepak7791 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2018, 06:35 PM
  2. Help writing formula for VLookup Function
    By Beneboys in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-19-2015, 07:57 PM
  3. Help with Formula/Function writing
    By Barry83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-27-2014, 04:26 PM
  4. getting table name while writing formula using insert function
    By paramnayak in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-31-2013, 09:57 AM
  5. [SOLVED] LINESTIF - Can you help me create an array formula to perform this function without VBA?
    By jglassmanba in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-26-2012, 05:45 PM
  6. Writing Text and Formula in the formula bar of a cell
    By modest_16081982 in forum Excel General
    Replies: 2
    Last Post: 08-27-2007, 05:25 AM
  7. Function/ formula to output a cell reference
    By Creator in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 02-17-2006, 05:30 PM

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