+ Reply to Thread
Results 1 to 3 of 3

Format number as specific names?

  1. #1
    Registered User
    Join Date
    01-15-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    18

    Format number as specific names?

    Hi all,

    I am working on a game in excel and am using numerical IDs to calculate when/where the characters, walls, enemies, etc. will populate. For example, 1 is a wall, 0 is a movable/open space, -1 is the player, -2 is an enemy, -3 a non-player character, -4, and so on. I was using a custom number format, [=-1]"Bob";[=-2]"Bat";"" but when I try to continue with [=-3] and so forth it gives me an error. I am inclined to think this is a limitation of the custom number formats but I hope someone has a solution or workaround.

  2. #2
    Registered User
    Join Date
    01-15-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    18

    Re: Format number as specific names?

    I did just figure out a workaround by using conditional formats and assigning each one it's own custom formatting. Is there a better way?
    conditional format if cell = -1 then number formatting = [-1]"Bob"
    conditional format if cell = -2 then number formatting = [-2]"Bat"
    conditional format if cell = -3 then number formatting = [-3]"NPC"
    etc.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858

    Re: Format number as specific names?

    I would have probably built a lookup table and used a lookup function in an adjacent cell. If you are unfamiliar with Excel's lookup function, I would suggest you start with the VLOOKUP() function: https://support.office.com/en-us/art...8-93a18ad188a1

    Some would depend on how critical it is to have the name appear in the same cell as the source number.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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] how to change format of specific text or number
    By alipezu in forum Excel General
    Replies: 2
    Last Post: 10-22-2015, 11:49 PM
  2. [SOLVED] Macros - adding number to specific names
    By eXtr3m3 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-22-2014, 02:37 AM
  3. [SOLVED] Setting a specific number format in Excel via VBA
    By Bezzie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-10-2014, 10:56 AM
  4. [SOLVED] Can I count the number of cells in a row that have a specific format?
    By M4rk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-09-2012, 07:26 PM
  5. [SOLVED] Need Job Number to auto generate in specific format
    By tjamestx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2012, 10:27 AM
  6. Excel 2007 : Format cell to specific number style
    By BigGPL in forum Excel General
    Replies: 3
    Last Post: 01-29-2012, 11:01 AM
  7. [SOLVED] How do I format cells to a specific number of digits?
    By Gabriele in forum Excel General
    Replies: 3
    Last Post: 02-05-2005, 12:06 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