Conditional Format to determine if cell is text or formula

StewartS

Board Regular
Joined
Feb 24, 2002
Messages
217
Hi

I have a table which one column can either be a vlookup formula or it will be possible for the user to overwrite a text value as well. In both cases the value comes from a data validation list. The data comes from a download of jobs which could be active, completed or rejected. So in principle the user could change an active job to completed and overwrite the formula.

I was wondering whether it is possible to identify with conditional formatting if the cell contains the vlookup formula or if it has been overwritten with a text value.

Thanks in Advance

StewartS
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Re: Conditional Format to determine if cell is texat or formula

Stewart,

Maybe like...
Excel Workbook
B
2By Formula
3Overwritten
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B21. / Formula is =CELL("prefix",B2)="'"Abc
B31. / Formula is =CELL("prefix",B2)="'"Abc


Hope that helps.
 
Upvote 0
Re: Conditional Format to determine if cell is texat or formula

If before 2013, you can make your own UDF...

Put in a code module:
Code:
Function ISFORMULA(Rng As Range)
ISFORMULA = Rng.HasFormula
End Function
Usage: just use like any other formula in Excel.
=ISFORMULA(A1)

With Conditional Formatting:
Select range that needs to be checked for cells that are not formulas

  • Conditional Formatting
  • Use formula...
  • Put this formula in: =NOT(ISFORMULA(A1))
    (Use the top left cell address of the selected range)
  • Choose formatting

(Note, in response to Snakehips solution, if the user enters pure numbers, the formula: =CELL("prefix",B2)="'" would return FALSE, but as you said: "if it has been overwritten with a text value", this probably won't happen, and the formula is then useful, simple and won't require macros as long as the user only overwrites with text)
 
Upvote 0
Re: Conditional Format to determine if cell is texat or formula

Hi thanks for the replies unfortunately I'm still on Excel 2010 but Snakehips details work although I changed the 1. / Formula is =CELL("prefix",B2)="'" to
1. / Formula is =CELL("prefix",B2)<>"'"

StewartS
 
Upvote 0
Re: Conditional Format to determine if cell is texat or formula

Thanks BQardi

I like this solution as it works if the user selects a blank value which is a possible result and as the workbook has some macros in it already adding the function in won't be a problem.

StewartS
 
Upvote 0
Re: Conditional Format to determine if cell is texat or formula

You're welcome...
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top