MrExcel Message Board
Support This Site


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2004, 03:41 PM   #1
Silo
 
Join Date: Mar 2004
Posts: 247
Default Custom Formatting

Hello everyone

I like to know if a cell or range of cells can be formatted to display a text valve along with the desired result.

I am working with a spreadsheet where I am tracking employee attendance, such as when someone calls out, take vacation etc

I am when COUNTIF and that work’s fine

What I like to do, is have for the words "Sick Days" displayed with along with the number of time example…

Sick Days, 3

Can this be done with custom formatting?

Thank you
Silo is offline   Reply With Quote
Old Mar 30th, 2004, 03:43 PM   #2
DRJ
MrExcel MVP
 
DRJ's Avatar
 
Join Date: Feb 2002
Location: California
Posts: 3,857
Default

Try this:

="Sick Days, " & Countif(yourformulahere)
__________________
Excel VBA Training and Certification (Lesson 1 is free)
<hr>

<hr>-Jacob
DRJ is offline   Reply With Quote
Old Mar 30th, 2004, 03:45 PM   #3
Jorgen
 
Join Date: Mar 2004
Posts: 54
Default Re: Custom Formatting

Hi,
Try going into formatting cell, select custom and type

General ", Sickdays"

or if you do not want the comma

General " Sickdays"

//Jörgen
Jorgen is offline   Reply With Quote
Old Mar 30th, 2004, 03:50 PM   #4
Silo
 
Join Date: Mar 2004
Posts: 247
Default

This is what I tried ="Sick Days, ",COUNTIF(C9:P9, "*Sick*")

Didn't work
Silo is offline   Reply With Quote
Old Mar 30th, 2004, 03:54 PM   #5
DRJ
MrExcel MVP
 
DRJ's Avatar
 
Join Date: Feb 2002
Location: California
Posts: 3,857
Default

You have to use & to combine the data not ,

="Sick Days, " & COUNTIF(C9:P9, "*Sick*")
__________________
Excel VBA Training and Certification (Lesson 1 is free)
<hr>

<hr>-Jacob
DRJ is offline   Reply With Quote
Old Mar 30th, 2004, 03:56 PM   #6
Jorgen
 
Join Date: Mar 2004
Posts: 54
Default

OK, So either do it with custom formatting using

"Sickdays, " General

or type your formula in the cell like

="Sick Days, " & Countif(C9:P9,"*Sick*")
Jorgen is offline   Reply With Quote
Old Mar 30th, 2004, 04:00 PM   #7
Silo
 
Join Date: Mar 2004
Posts: 247
Default

Thanks that work prefectly
Silo is offline   Reply With Quote
Old Mar 30th, 2004, 04:15 PM   #8
Zack Barresse
MrExcel MVP
 
Zack Barresse's Avatar
 
Join Date: Dec 2003
Location: Oregon, USA
Posts: 9,624
Default

one caviat from putting the text in the same cell, is you can no longer use this figure for numerical input. well, not by directly referencing it, eg C7.

let's say you had a number like (may not apply to you)...

'15 Sickdays' - from your computation.

find the constant, that's the key. 'sickdays' has eight letters, one space between. that's your constant here. for examples sake, we'll say that's the total length you'll have. we'll also say that the number can contain any number of digits (1, 2, or 3 even). to reference the number '15', you'll need something like =LEFT(A1,LEN(A1)-9)

the -9 is where your adjustments should go if your text length will vary.

food for thought. hth
__________________
Regards,
Zack Barresse

All Excel Functions
(If you would like comments in any code, please say so.)
Zack Barresse is offline   Reply With Quote
Old Mar 30th, 2004, 04:19 PM   #9
DRJ
MrExcel MVP
 
DRJ's Avatar
 
Join Date: Feb 2002
Location: California
Posts: 3,857
Default

Your Welcome

Take Care
__________________
Excel VBA Training and Certification (Lesson 1 is free)
<hr>

<hr>-Jacob
DRJ is offline   Reply With Quote
Old Mar 30th, 2004, 04:38 PM   #10
Silo
 
Join Date: Mar 2004
Posts: 247
Default

Great tip firefytr I'm keeping it for reference I really appreciate the tips
Silo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 07:04 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.