ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is it possible to create your own custom format? (https://www.excelbanter.com/excel-discussion-misc-queries/56730-possible-create-your-own-custom-format.html)

Scott Steiner

Is it possible to create your own custom format?
 
Hi,

I have a column that represents the weekday (number from 1-7) of a date
by using the worksheet weekday function. I used the custom format "dddd"
on that column to display the values as days (Sunday, Monday, ....)
rather than numbers.

Question: I want to display the days in a different language without
having to change the regional code of the PC. Is it possible to create
my own custom format that changes the way the column is displayed
_without_ changing the underlying value which is a number from 1-7?

I tried writing my own weekday function which displays fine but the
problem is that it also changes the underlying value of the cells which
I don't want to do as this affects other calculations.

Thanks for any help on how to tackle this problem!

Ron Coderre

Is it possible to create your own custom format?
 
Would something like this work for you?:

First, create a lookup table for the days:

Example (using French):
D1: Mon
E1: Lundi
D2: Tue
E2: Mardi
(etc)

For a date in A2:
B2: =VLOOKUP(TEXT(A2,"ddd"),D1:E7,2,0)

Does that help?

***********
Regards,
Ron


"Scott Steiner" wrote:

Hi,

I have a column that represents the weekday (number from 1-7) of a date
by using the worksheet weekday function. I used the custom format "dddd"
on that column to display the values as days (Sunday, Monday, ....)
rather than numbers.

Question: I want to display the days in a different language without
having to change the regional code of the PC. Is it possible to create
my own custom format that changes the way the column is displayed
_without_ changing the underlying value which is a number from 1-7?

I tried writing my own weekday function which displays fine but the
problem is that it also changes the underlying value of the cells which
I don't want to do as this affects other calculations.

Thanks for any help on how to tackle this problem!


Scott Steiner

Is it possible to create your own custom format?
 
Ron Coderre wrote:

Would something like this work for you?:

First, create a lookup table for the days:

Example (using French):
D1: Mon
E1: Lundi
D2: Tue
E2: Mardi
(etc)

For a date in A2:
B2: =VLOOKUP(TEXT(A2,"ddd"),D1:E7,2,0)

Does that help?


Unless I'm doing something wrong here, using vlookup is also changing
the underlying value of the cell.

At the moment the table looks like this:

- column A has dates stored
- column B is simply =WEEKDAY(A) using custom format "dddd" i.e. column
has numbers from 1-7 stored but these are represented as days without
changing the underlying value.

Using VLOOKUP is changing the underlying value of the cell i.e. not only
is "Sunday" displayed but "Sunday" is also actually the value of the
cell, something I want to avoid.

Ron Coderre

Is it possible to create your own custom format?
 
Try this:

Since Column B already has the day number

Example (using english)
C2: =CHOOSE(B2,"Sun","Mon","Tue","Wed","Thu","Fri","Sa t")

Does that help?

***********
Regards,
Ron


"Scott Steiner" wrote:

Ron Coderre wrote:

Would something like this work for you?:

First, create a lookup table for the days:

Example (using French):
D1: Mon
E1: Lundi
D2: Tue
E2: Mardi
(etc)

For a date in A2:
B2: =VLOOKUP(TEXT(A2,"ddd"),D1:E7,2,0)

Does that help?


Unless I'm doing something wrong here, using vlookup is also changing
the underlying value of the cell.

At the moment the table looks like this:

- column A has dates stored
- column B is simply =WEEKDAY(A) using custom format "dddd" i.e. column
has numbers from 1-7 stored but these are represented as days without
changing the underlying value.

Using VLOOKUP is changing the underlying value of the cell i.e. not only
is "Sunday" displayed but "Sunday" is also actually the value of the
cell, something I want to avoid.


MrShorty

Is it possible to create your own custom format?
 

There have been several occasions where I've wanted to add my own custom
number format code. To date, I haven't found a way. If what you want
to do isn't somehow supported by Excel's built in custom number format
codes, then you have to do something like Ron is suggesting: One cell
to hold the value for future calculations and one cell in the table
that holds the "displayed" value.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=487227


Gary''s Student

Is it possible to create your own custom format?
 
1. Select an un-used cell and enter 1 into it.
2. Pull-down:
format cells Number Custom and enter "mun" in place of general

3. The cell will show mun, but the formula bar will show it is still a 1 and
will function arithmetically as a 1.

Repeat this for 2-7. Then either manually thru copy/paste/special format or
via a macro apply this format to any cells containing number-days you want
displayed in your language of choise.
__________________________________________________ ___
Gary's Student


"Scott Steiner" wrote:

Hi,

I have a column that represents the weekday (number from 1-7) of a date
by using the worksheet weekday function. I used the custom format "dddd"
on that column to display the values as days (Sunday, Monday, ....)
rather than numbers.

Question: I want to display the days in a different language without
having to change the regional code of the PC. Is it possible to create
my own custom format that changes the way the column is displayed
_without_ changing the underlying value which is a number from 1-7?

I tried writing my own weekday function which displays fine but the
problem is that it also changes the underlying value of the cells which
I don't want to do as this affects other calculations.

Thanks for any help on how to tackle this problem!



All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com