![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Join Date: Mar 2004
Posts: 247
|
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 |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: California
Posts: 3,857
|
Try this:
="Sick Days, " & Countif(yourformulahere) |
|
|
|
|
|
#3 |
|
Join Date: Mar 2004
Posts: 54
|
Hi,
Try going into formatting cell, select custom and type General ", Sickdays" or if you do not want the comma General " Sickdays" //Jörgen |
|
|
|
|
|
#4 |
|
Join Date: Mar 2004
Posts: 247
|
This is what I tried ="Sick Days, ",COUNTIF(C9:P9, "*Sick*")
Didn't work |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: California
Posts: 3,857
|
You have to use & to combine the data not ,
="Sick Days, " & COUNTIF(C9:P9, "*Sick*") |
|
|
|
|
|
#6 |
|
Join Date: Mar 2004
Posts: 54
|
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*") |
|
|
|
|
|
#7 |
|
Join Date: Mar 2004
Posts: 247
|
Thanks that work prefectly
|
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Dec 2003
Location: Oregon, USA
Posts: 9,624
|
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.) |
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Feb 2002
Location: California
Posts: 3,857
|
Your Welcome
Take Care |
|
|
|
|
|
#10 |
|
Join Date: Mar 2004
Posts: 247
|
Great tip firefytr I'm keeping it for reference I really appreciate the tips
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|