Formatting a cell based on a list in Excel - excel

I'm trying to format a single cell within a worksheet, so that it is highlighted if a postcode contained within a long list of postcodes is entered. The cell I'm trying to conditionally format is E26, and the list of postcodes is A63:A2559, and the postcodes are all entered without a space (e.g. SW1A0AA). I've tried a number of ways and formulas to conditionally format the cell (=MATCH, etc), but I keep getting error messages, or it just doesn't format the cell. Is anyone able to help me with a formula?
Thanks in advance

I just tested this formula, if I understand your requirements correctly, it works.
=NOT(ISERROR(MATCH($E$26,$A$63:$A$2559,0)))
My picture below uses different ranges, but just you so how I laid the data - to mimic what I understood as your data set. If it's different, let me know.
E6 passes the test, F6 does not.

Related

Excel Dynamic Conditional formatting

I am sure this is really simple but cannot get it to work. I am trying to do some conditional formatting on a sheet that over time will have additional columns added to it. I want the formatting to be there before hand since the data is being added via VBA and the person using the spreadsheet are not Excel experts.
What I have is a column with numbers in. When a new column is entered I want to compare the value with the value in the previous column and then colour the cell accordingly. I can do this for a single cell with for example "=D2>C2".
I want to be able to write the rules in cell D2 comparing it with cell C2 and then have the rules apply across the area D2:DDD300. So for example cell N19 will compare itself to cell M19.
I thought I could use the "Applies to" box but that does not work. Any ideas on how I can achieve this?
Okay this now appears to be working. Not sure what I did differently but deleted all the rules and then set them up again. The only thing I did different was to initially do it for just the 1 cell, then expanded it out to the row when I knew it was working, then finally the whole area.
Sorry to have wasted peoples time
Your method should work. It does for me. Maybe this helps:

How can I make a criteria in an excel forumla reference text in another cell?

I am using a SUMIFs formula in excel. One of my criteria consists of text, but the text will vary for every row I am applying this formula too. Rather than typing out that text for each column, I'd like to find a way to include in my formula the reference for where that text comes from, and have excel grab it for each row.
This picture shows what I am currently working with.
The last term in the formula is "BT-107-141-1". That is also the value of A2 in this sheet. Rather than typing "BT-107-141-1" (and doing the same thing for every row I have), can I direct excel to use whatever value is in A2 as the criteria in this formula?
I was trying to use INDIRECT, but couldn't get it to work. Something like "VALUE($A2)" might work?
Please let me know if you have any questions, I would really appreciate some help! Thanks.

Excel - Value not recognized in Range

In Excel I'm trying to compute a value which depends on other range value. I have a very strange problem: the same formula with different value doesn't work for some case.
This formula works:
ROUNDUP(AVERAGE(IF(RangeName1=1;RangeName2));2)*100&" %."
This one doesn't:
ROUNDUP(AVERAGE(IF(RangeName1=2;RangeName2));2)*100&" %."
I check and my RangeName1 does contain these values: 1 and 2 (order like this).
Does anybody has an idea why the second formula doesn't work?
When I try your formula's both work fine.
Can you tell us what you are trying to achieve?
If you want to display percentage in a cell you could also use cell formatting, this way your cell will only contain the actual number displayed in a certain way instead. see http://www.excel-easy.com/basics/format-cells.html for reference.

Getting values from multiple disconnected cells

I'm trying to retrieve values from cells on the same row spaced 20 columns apart.
Right now I have put together the following formula to retrieve the values in the first five cells I am interested in:
={IF(OR(IF({1,2,3,4,5}*20+1<25,CHAR(MOD({1,2,3,4,5}*20+1,26)+64),CHAR(INT(({1,2,3,4,5}*20+1)/26)+64)&CHAR(MOD({1,2,3,4,5}*20+1,26)+64))&ROW()="OK"),"OK","N/G")}
The cells contain the results of calculation checks. The result if given as either "OK", "N/G" or "N/A". Right now I am interested in determining if even a single cell reports "OK", hence using the OR in the formula.
The problem is that whilst this gets the address of the cells correctly, they are returned as text. OR then does a text comparison on the addresses and the criteria and finds that none of the addresses are "OK"... which is logical, but not what I want.
I have tried using INDIRECT(), but that doesn't seem to work when it is in the form ={INDIRECT("A1","B2","C3")}. Could anybody suggest a way to change the text addresses to addresses which will correctly be interpreted by the formula?
I could write some vba code for this, but I'd like to use a formula solution if possible.
With a static stagger to the columns you want to examine, you can use MOD() to determine their ordinal position on the worksheet.
         
The formula in CE2 is =IF(SUMPRODUCT(($A2:$CC2=CE$1)*(MOD(COLUMN($A:$CC),20)=1)), "Yes", "No"). Fill right and down as necessary.

Checking cell value dynamically

What I'm doing is a simple map on one tab of an office space that has all the cubicals laid out. On this map, I have conditional formatting checking another table of listen computers for the last time they were updated/maintained. It works as it stands, but we are moving into a new building and the map (which is already done) has WAY more cubes than last time. So I'm trying to figure out a more efficient way to do this task.
Here is the code:
=AND(VLOOKUP("CCA C1",LOCATION,3,FALSE)<>"",VLOOKUP("CCA C1",LOCATION,3,FALSE)<TODAY()-80)
So as it sits, it works fine. But what I'm trying to do is change the "CCA C1" to simply read the contents of the cell it's formatting so I can just format an entire range of cells rather than doing it cell by cell. The "CCA C1" is in the location of the second sheet (it's a named range). So this checks that entire range for "CCA C1" and checks if the date a couple columns over in that row is within 80 days, if it's not it highlights the cell in the map in red reminding us we need to check the computer. But what I would like to do is simply put "CCA C1" in the cell in the map (which is already is labeled), and have this check for the value of the cell it's formatting and look for that value the same way it's looking now. Just without me having to put "CCA C1" in the formula, I'd like to say something like this:
=AND(VLOOKUP(CURRENT CELL VALUE,LOCATION,3,FALSE)<>"",VLOOKUP(CURRENT CELL VALUE,LOCATION,3,FALSE)<TODAY()-80)
Make sense? Anyone know of a way to do this? Otherwise I have to conditionally format each individual cell with the value manually rather than just format all the cells with the same formatting and have the formula check the contents of the cell for what to look for in the location range of the other sheet.
And to clarify, I know that I can put in the actual cell, such as E3, but then I still have to manually change the formula for each cell which defeats the purpose. I want to just say current cell or something like that. I have 3 conditional formats for each cell, I have around 100 cells to be formatted, so rather than having 300 formats I have to put in, I'd love to just do 3. Not sure if this is possible, that's why I'm asking :)
Just replace "CCA C1" with the address of the first cell in the range of cells with the conditional formatting. Assuming your conditional formatting starts in B2:
=AND(VLOOKUP(B2,LOCATION,3,FALSE)<>"",VLOOKUP("CCA C1",LOCATION,3,FALSE)<TODAY()-80)
EDIT: As I commented, I'm not sure I understand the issue, but if I do, you need to enter the range of cells with CF in the applies to range of the CF dialog, rather than copying and using Paste Special:
Note that this works with the merged cells.
You will need to adjust the applies to range as you add more computers, etc., but the same formula will work.

Resources