Match with conditional format in excel 2003
Solved/Closed
ConfusedPeopleMover
-
Apr 6, 2010 at 01:56 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 12, 2010 at 10:59 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 12, 2010 at 10:59 AM
Related:
- Match with conditional format in excel 2003
- Marksheet format in excel - Guide
- Excel date format dd.mm.yyyy - Guide
- Format factory - Download - Other
- Number to words in excel - Guide
- Music match jukebox - Download - Audio playback
6 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 6, 2010 at 05:51 PM
Apr 6, 2010 at 05:51 PM
Well I am sure there is other way to do it too. This is a proposed solution for your two issues
1. Indicate which name is not present in the GRID
2. If name is present, location of that person
I am proposing two functions.
A. One function isPresent(range, string) returns true or false depending if the name was found in the GRID or not
B. The other function PresentAt(range, range, string) returns a string. This string will either contain the location name or "Not Available" if the name is not found
Step1
1. Create a new Named range "LOCATION". This is the name of various location you have on your sheet2, row 2. This range should start from the same column where the GRID name range starts and should end at the same column where the GRID named range ends
2. Open VBE by pressing ATL + F11 and then inserting a new module
3. Paste the code below ( after the instructions)
4, Once the code has been pasted. Select the row containing the names on sheet1
5 Go to Conditional formatting and enter this formula
=NOT(OR(A$5="",ispresent(GRID,A$5)))
NOTE : A$5 is based on your sample book, In that the names were on ROW 5. Change it to what ever rows they actually are
6 Go to format under conditional formatting and pick the color of your choice
Here is the code
1. Indicate which name is not present in the GRID
2. If name is present, location of that person
I am proposing two functions.
A. One function isPresent(range, string) returns true or false depending if the name was found in the GRID or not
B. The other function PresentAt(range, range, string) returns a string. This string will either contain the location name or "Not Available" if the name is not found
Step1
1. Create a new Named range "LOCATION". This is the name of various location you have on your sheet2, row 2. This range should start from the same column where the GRID name range starts and should end at the same column where the GRID named range ends
2. Open VBE by pressing ATL + F11 and then inserting a new module
3. Paste the code below ( after the instructions)
4, Once the code has been pasted. Select the row containing the names on sheet1
5 Go to Conditional formatting and enter this formula
=NOT(OR(A$5="",ispresent(GRID,A$5)))
NOTE : A$5 is based on your sample book, In that the names were on ROW 5. Change it to what ever rows they actually are
6 Go to format under conditional formatting and pick the color of your choice
Here is the code
Function isPresent(NameGrid As Range, lookup As String) As Boolean 'NameGRID: the grid that contain names and location of person 'lookup : name that is to be searched in GRID Dim temp As String ' to upper case as we would be comparing the names latter and ' want to take out any issues due to upper or lower cases of ' alphabets temp = UCase(lookup) 'default the name is not present isPresent = False ' looping thru each cells in GRID For Each cell In NameGrid 'comparing names If UCase(cell.Value) = temp Then 'name has been matced isPresent = True Exit Function End If Next End Function Function PresentAt(LocationGrid As Range, NameGrid As Range, lookup As String) As String 'LocationGrid: the named ranged that has the locations only. 'NameGRID: the grid that contain names and location of person 'lookup : name that is to be searched in GRID Dim temp As String Dim lItem As Long Dim Locations As Long temp = UCase(lookup) 'default PresentAt = "Not Available" lItem = 0 ' array pointer Locations = LocationGrid.Cells.Count 'number of cells in the locations grid For Each cell In NameGrid lItem = lItem + 1 If UCase(cell.Value) = temp Then PresentAt = LocationGrid.Cells(1, lItem) Exit Function End If If lItem = Locations Then lItem = 0 Next End Function
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 6, 2010 at 03:17 PM
Apr 6, 2010 at 03:17 PM
Could you please post a sample book at some share site like https://authentification.site and post the link here.
The link takes me to a "forbidden server" message. I tried to post an upload with this very site when I first posted but I got the same thing when I tried to upload before. I shall try using IE rather than Google Chrome to get to the site but if that fails, is there any other option? I could make my description clearer?
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 6, 2010 at 03:49 PM
Apr 6, 2010 at 03:49 PM
Strange, I was able to go. You have been very clear. It is just that i find picture speaks louder than the words. Could you mail me the file at "rizvisa at hotmail dot com" . Hopefully no virus, no Trojans or worms :P
Didn't find the answer you are looking for?
Ask a question
That worked fine thanks.
I would be interested to know why an "address(match..." function wouldn't work for this. I have had some luck with this in the past but this time it didn't work.
I would be interested to know why an "address(match..." function wouldn't work for this. I have had some luck with this in the past but this time it didn't work.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 8, 2010 at 02:45 PM
Apr 8, 2010 at 02:45 PM
It was a multidimensional array (YOUR GRID). I could get match work for a single dimensional array. There might be a way, I was just unable to come up with match and multidimensional array
Apr 6, 2010 at 06:05 PM
Use this for condtional formatting
=NOT(OR(A$5="",presentAt(LOCATIONS,GRID,A$5)<>"Not Available"))
In this case you do not need any isPresent function and only PresentAt is needed than
Apr 12, 2010 at 08:53 AM
I kept all ranges with the same names as defined in your answer and the result is "true", didn't the person who asked the question want to return the "location" of the value? If not then i do, how do i return the column header for a value?
Apr 12, 2010 at 09:01 AM
Apr 12, 2010 at 10:44 AM
Apr 12, 2010 at 10:59 AM
in cell you should have some thing like this
=PresentAt( LocGrid, NameGrid, A2)
where LocGrid is the name of the range for location
NameGrid is the name of the range that stores names
and A2 is just an example saying that I want to search for the value this is found in cell A2
If it still does not work, post your formula here