![]() |
If cell is Bold then 1, if cell is Italics then 2?
I have a list of hundreds of cells, the cells are either Bold, Italics, or
Regular. I want those cells that are bold to result in 1 in another column. those in italics to will result in 2. Am I able to write a "if" function that achieve this? If not, what should I do? Please kindly advise |
Answer: If cell is Bold then 1, if cell is Italics then 2?
Yes, you can use an "IF" function to achieve this. Here are the steps:
Note: This formula uses the CELL function to check the format of the cell. The "B1" and "I1" arguments in the formula refer to the codes for bold and italic formatting, respectively. |
One way, assuming data is in col. A:
1. Press Ctrl+F3. 2. Define the name "istyle" (no quotes) and in the "Refers To:" box put: =IF(GET.CELL(20,!$A1),1,IF(GET.CELL(21,!$A1),2,"") ) 3. In cell B1 put: =istyle 4. Copy the formula down. 5. If you're using XL2002 or earlier, read this: http://tinyurl.com/3lnld HTH Jason Atlanta, GA -----Original Message----- I have a list of hundreds of cells, the cells are either Bold, Italics, or Regular. I want those cells that are bold to result in 1 in another column. those in italics to will result in 2. Am I able to write a "if" function that achieve this? If not, what should I do? Please kindly advise . |
NB!
I'm sure Jason knows this: This method does not automatically update when changes are made to the cells formats. Changing a cells format from BOLD to NORMAL or vice versa doesn't trigger an event so the formula will not reflect the change until the next calculation. Biff -----Original Message----- One way, assuming data is in col. A: 1. Press Ctrl+F3. 2. Define the name "istyle" (no quotes) and in the "Refers To:" box put: =IF(GET.CELL(20,!$A1),1,IF(GET.CELL(21,!$A1),2,"") ) 3. In cell B1 put: =istyle 4. Copy the formula down. 5. If you're using XL2002 or earlier, read this: http://tinyurl.com/3lnld HTH Jason Atlanta, GA -----Original Message----- I have a list of hundreds of cells, the cells are either Bold, Italics, or Regular. I want those cells that are bold to result in 1 in another column. those in italics to will result in 2. Am I able to write a "if" function that achieve this? If not, what should I do? Please kindly advise . . |
Good point Biff. I forgot to mention that.
Jason -----Original Message----- NB! I'm sure Jason knows this: This method does not automatically update when changes are made to the cells formats. Changing a cells format from BOLD to NORMAL or vice versa doesn't trigger an event so the formula will not reflect the change until the next calculation. Biff -----Original Message----- One way, assuming data is in col. A: 1. Press Ctrl+F3. 2. Define the name "istyle" (no quotes) and in the "Refers To:" box put: =IF(GET.CELL(20,!$A1),1,IF(GET.CELL(21,!$A1),2,"") ) 3. In cell B1 put: =istyle 4. Copy the formula down. 5. If you're using XL2002 or earlier, read this: http://tinyurl.com/3lnld HTH Jason Atlanta, GA -----Original Message----- I have a list of hundreds of cells, the cells are either Bold, Italics, or Regular. I want those cells that are bold to result in 1 in another column. those in italics to will result in 2. Am I able to write a "if" function that achieve this? If not, what should I do? Please kindly advise . . . |
All times are GMT +1. The time now is 10:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com