+ Reply to Thread
Results 1 to 34 of 34

Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

  1. #1
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Hi,

    I've got two pivot tables on one worksheet. Each has data with codes (ex: CAM for campaign, CLI for client, OTH for other, etc). I want to be able to stick in formulas that will replace the codes with the full text in both pivot tables. The codes are in column A in the first pivot, and column I in the second. I can't seem to get anything working

  2. #2
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    are you able to attach a sample workbook?

  3. #3
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Hi Maym, attached
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    can you not include the descriptions (i.e. full text) in both of your spreadsheets (Inquiries and comm) and then pivot off that?

  5. #5
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    technically I could run a formula on those data sets (generated by our system) every time we drop them in the worksheets, but I was hoping to have a set formula on the main summary sheet so it automatically did it. Not possible?

  6. #6
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    A calculated field would help but only if you have values (text would not work so you couldn't do something like =if(field1="code",.."

    The only way I know is to add the if function to the data sets. You could write a macro so you don't need to run the formula every time?

  7. #7
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Thanks. I'm not good with macros so won't be able to do that :-/

  8. #8
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    well, status and status description already appear to be in the comm sheet, is this how the data comes in, or did you need to add this manually? On Inquiries sheet, you can also add lead interest description, or did you add lead interest manually?

    You can run a macro when you drop the data into your sheets, if I have the right info I can help you with this.

  9. #9
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Hi maym, all the data in the Comm and Inquiries tabs are how our system spits them out - not able to add more description columns unfortunately - got lucky with the status and lead interest description columns.

  10. #10
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    so when the system spits them out, are you not able to add columns when you put them into your summary workbook? Or are you not allowed to add any more columns period? If you can, upon import you can run a macro but just checking this first.

  11. #11
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    we can add columns, but ideally trying to make it as easy as possible and not have to mess around adding multiple things each time

  12. #12
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    ok. Pretty sure it is difficult to manipulate the field in the pivot table (particularly a text field) so macro is the only way I can think of.

    You could set it up so that you run it each time which wouldn't be difficult and would give you the required result. But sounds like you a looking for solution to my first point.

  13. #13
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    we could run it each time

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Could you show the result you want? Mock up manually if necessary.

  15. #15
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Hi Sandy, example attached (desired result in yellow)
    Attached Files Attached Files

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Thanks
    I think {} it can be done via PowerPivot related Table
    but ususally Ex2010 need free add-in from MS like PowerPivot and PowerQuery

    Maybe VBA will be a good solution but I am away from VBA

  17. #17
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    and I thought this would be an easy one

  18. #18
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    It is but many clicks

    so, what about mentioned add-ins?

    or you prefer VBA without add-ins

  19. #19
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    a macro would do it, I am just pushed for time right now. Will be able to get back to you later on it

  20. #20
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    I c vba is in progress
    so have a nice day and good luck

  21. #21
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  22. #22
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    @shukla.ankur281190

    post#3 & post#15

  23. #23
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    @Sandy666 Have you understood ?? I am still trying... Can you please tell me what does Megs35 want ?

  24. #24
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    in short: OP want change automatically shortcuts to descriptions (see post #15)

    2017-10-23_082323.jpg
    Last edited by sandy666; 10-23-2017 at 02:25 AM.

  25. #25
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Hi,

    You could use something like this
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  26. #26
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    try this attached also (click the 'run update' button on the summary sheet).
    Attached Files Attached Files

  27. #27
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Just for fun

    but PowerPivot add-in is required (PowerQuery add-in is very usefull also)
    Attached Files Attached Files

  28. #28
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    maym - Got "Runt time error "5" Invalid procedure call or argument"
    Last edited by Megs35; 10-23-2017 at 10:53 PM.

  29. #29
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Seem to have gotten in over my head with the macros and vba- will need to do some studying before I can try again to make these work.

    Thank you everyone!

  30. #30
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Hi Megs, I made some changes. Please see if the attached works.

    BTW, I would just use xlnitwit's code, it works directly off the pivot table and eliminates the additional work I have done in mine.
    Attached Files Attached Files

  31. #31
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    version attached with xlnitwit's code. I have added a button for ease of use. You can decide which one you want to use.
    Attached Files Attached Files

  32. #32
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    Oh wow - it worked! xlnitwit :-)

    Thank you all for your work and suggestions - very much appreciated

  33. #33
    Registered User
    Join Date
    10-17-2017
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    17

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    maym - awesome! Thank you so much

  34. #34
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help with simple REPLACE / SUBSTITUTE formula for 2 pivot tables

    glad to help

    If that takes care of your original question, and to say thanks, please click on 'Add Reputation' (bottom left corner of the post of the person(s) who helped you), then select Thread Tools from the menu (top right corner of your thread) 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] Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  2. Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. [SOLVED] Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. [SOLVED] Substitute for Pivot tables?
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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