+ Reply to Thread
Results 1 to 3 of 3

Substitute function help - number swapping with like numbers

  1. #1
    Registered User
    Join Date
    02-27-2023
    Location
    CA, USA
    MS-Off Ver
    Excel for Mac
    Posts
    1

    Substitute function help - number swapping with like numbers

    Hi!

    I'm working with a raw data set that has values ranging from 1-6 as responses. I need to substitute all 1 values for 6, 2 values for 5, 3 values for 4, and then vice versa. I've tried the 'Substitute function': =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(P5,"1","6"),"2","5"),"3","4"),"4","3"),"5","2"),"6","1") ... the function works to convert values 4 to 3, 5 to 2, and 6 to 1 but not the other way around.

    Does anyone know of a more efficient or better way to solve this?

    I am using Excel on mac OSventura.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,293

    Re: Substitute function help - number swapping with like numbers

    Formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Substitute function help - number swapping with like numbers

    Why not just:

    =7-P5

    Hope this helps.

    Pete

+ 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. Replies: 1
    Last Post: 02-10-2023, 10:18 AM
  2. [SOLVED] Substitute or replace number segment on multiple number range
    By AMOON12 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-05-2020, 03:54 PM
  3. [SOLVED] Replace/Substitute/Exchange words to numbers
    By jarrgonn in forum Excel General
    Replies: 9
    Last Post: 12-10-2019, 02:03 AM
  4. [SOLVED] Substitute Numbers
    By ShakJames in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-16-2019, 05:13 AM
  5. Substitute function problem- Numeric as Text-Need to have those as Number
    By punno2015 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2019, 11:54 AM
  6. How do I substitute numbers for certain words?
    By Pyrex238 in forum Excel General
    Replies: 1
    Last Post: 02-20-2012, 09:55 PM
  7. Format Numbers For Substitute
    By Cza102282 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-05-2009, 05:03 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