lock in a vlookup column - excel

so I have the following formula and I'm trying to create a stable formula where $o4$p74 is stapled and wont change. However, I need to constantly delete the p-column and then I do that, the vlookup changes from p to o and continues if I keep deleting the P-column. I'm trying so that it always returns the P-column value in which is always getting deleted, is there any ideas of how to go about this?
=VLOOKUP(B437,BHR8732A2!$O4:$P74,2,FALSE)*$S437

Another solution based on Allen's would be:
=VLOOKUP(B437,indirect("'BHR8732A2!'$O4:$P74"),2,FALSE)*$S437
Keeps it all nicely in a cell.

Have you thought about putting an =P1 before the column you are deleting? That would give you a ref error on the delete but I think it is easier to deal with that then messing with the vlookp each time.
Just found "=indirect("F2")" here
You could do that int the vlook up or using the suggestion above

You can use Offset to resize a reference to column O only, like this
=VLOOKUP(B437,OFFSET(BHR8732A2!$O4:$O74,,,,2),2,FALSE)*$S437
Note: this will make the formula Volitile

Related

highlight closest/farthest value to zero

I need to find a way to highlight closes and farthest value to/from 0 in my excel table. I know easiest way to achieve it is by using conditional formatting, however I can not do it correctly even with help of tutorials. Based on this site:
https://www.extendoffice.com/documents/excel/4095-excel-highlight-closest-value.html
i used formula
=ABS(A2-$D$2)=MIN(ABS($A$2:$A$15-$D$2)) on my test data but it dosent work... What am I doing wrong?
I would add a helper column that is absolute value of difference. Then add another cell that's min of that column. Will make it easier to debug.
This issue was related to my system exclusively. Worked on other computer. Got new system and this problem never occurred again.

Finding value with similar headers in multiple columns

I am trying to do an Offset/Match or Index/Match type formula to find the value that matches a cell. The problem is the way the sheet is laid out.
For an example I am trying to match the Job No. to the Project Name under the appropriate client.
I would like to keep it in this format because the project list will grow.
This sheet is where my lists are kept.
*This is just being created hence why the Project lists are tiny.
This sheet will be an ever expanding list of stuff that needs to be done.
You can see the OFFSET formula below that I tried. Is there another way of doing this or can this be done with a simple formula (instead of a long IF statement for each Client)?
=OFFSET(D2,MATCH(D3,Lists!F3:P10,0),MATCH(J2,Lists!F3:P3,0))
Thanks for any feedback.
=VLOOKUP(D3,OFFSET(Lists!$E$4:$E$10,,MATCH(C3,Lists!$F$2:$P$2,0),,2),2,0)
It seems a bit more awkward to do it with INDEX/MATCH because you have to repeat the column lookup, but here it is
IFERROR(INDEX(INDEX($F$4:$P$10,,MATCH(C3,$F$2:$O$2,0)+1),MATCH(D3,INDEX($F$4:$P$10,,MATCH(C3,$F$2:$O$2,0)),0)),"")

Using a Variable in Excel for COUNTIF

First time question and I hope it's easier than I'm making this.
Can I use a variable inside a COUNTIF formula?
Currently my formula is:
=COUNTIF($C$2:$C$415,R6)
I would like to have $415 as my variable. I have tried something along the lines of:
D1=415=COUNTIF($C$2:$C$(D1),R6) ..
but obviously get a error.
The reason I need this is column C will constantly be incrementing as I add more rows.
Instead of going into each of my formulas and updated 415 to 416, 417 etc, I would like to just define a Cell that can be my variable, or total rows.
Currently Column C can have blank cells, so I can't have a macro that finds the next empty cell.. but I do however have Column A with a constant populated cell and stops at the last ticket. However Column A is unrelated to the COUNTIF.
UPDATE 1
I'd also like to mention that I'd be using this variable in many formulas in the spreadsheet. Not only COUNTIF's. Also, the COUNTIF contains text.
UPDATE 2
Actually, I figured it out! I am using this formula instead:
=COUNTIF(INDIRECT("C"&D1&":A"&D2),R6)
I'm putting D1=2 and D2=415 and will just update cell D2 with how many rows I have.
I guess I just needed to ask the question thoroughly to fully understand what I wanted!
Thank you in advance for all help, tips and suggestions.
Would "=COUNTIF($C:$C,R6)" do the trick? This will apply COUNTIF to the whole of column C. It's an easy solution, but probably not the most efficient.
I prefer tables for storing data; as new data is added, the table automatically expands and the columns are already labeled (much like Named Ranges). Then you can have =COUNTIF(Table1[Column1],"Criteria"), which will encompass any new rows added to the table automatically. Especially helpful if you have multiple tables in the same column.

Conditional Format cell if it's value is found in a Column of a Table

I thought this was going to be Very simple:
=COUNTIF(Foo[Bar],$A1)>0
applying this to the entire column I thought would highlight any cell that is found in the Column Bar of table Foo. But excel is telling me my formula contains an error, even though when I paste it into a cell it does give me a correct value of True/False.
I thought maybe for some reason I needed to complicate it for excel so i tried:
=COUNTIF(Foo[Bar],$A1) + CountIf(A1:A10000, $A1>1
Not sure why i tried it but I figured why not. Regardless is did not work.
I then went on to blame the Range (Foo[Bar]) and tried:
=COUNTIF($T$2:$T$1048576,$A1)>0
It Worked, the issue here is that that table's row count can change from 1 to anything depending on out days progress. I'd prefer not to just use 50000 as a number because it might not always be good enough and most of the time over kill. and causes refreshed to take for ever when Column A is closing in on 1 million records some days and the table is at 100,000.
So, how can I dynamically conditionally format my column to reflect table?
Try
=COUNTIF(INDIRECT("Foo[Bar]"),$A1)>0
Maybe (I've not tested this) it would work with a named range. Say name Foo[Bar] as CheckList and use something like =MATCH($A1,CheckList,0)>0 in CF. This works for an existing table that is extended with entries under [Bar] but I am not sure what would happen for you on table update, though pasting other data over the top of my table does work.
Try:
=COUNTIF(Foo[[#Data],[Bar]],$A1)>0
or if your in this table,
=COUNTIF(Foo[[#Data],[Bar]],Foo[[#This Row],[A Header]])>0
Also a good resource is to use the auto complete feature Excel give you. This will ensure your references are accurate.

Concatenate Formula (Getting a #REF Error)

Afternoon all :)
This is kind of a little difficult to explain but ill happily clarify where ever it is needed. Thank you for taking the time to read this post ^^ Here goes..
I am currently creating a spreadsheet that is been extracted from the database whereby I am tasked to concatenate data from 2 adjacent cells. I change the database on a frequent basis adding or removing data wherever necessary so the range of data is always different. To concatenate the two cells I use the following formula:
e.g: =IF(ISBLANK(B8&H8),"",B8&H8)
This formula works out great when im dealing with increasing amounts of data as I can simply drag the formula down as far as i want and i know that it will pick up the formula whenever I refresh the database without the need of seeing value errors when the formula ends up referring to a blank cell. The snag here (and my query as well) is if I have less data then before the formula within the last set of cells looks something like this:
e.g: =IF(ISBLANK(#REF!&#REF!),"",#REF!&#REF!)
I have dealt with #REF before in other spreadsheets whereby I simply used a ISERROR in the statement but I dont know if there is a possible way of including this within my formula. I need the ISBLANK there so I have more control and dont have to drag the formula as often.
If there is a better way around this or a way to amend the current formula Id appreciate the help :)
The only way you are going to get something like this:
=IF(ISBLANK(#REF!&#REF!),"",#REF!&#REF!)
in the formula bar is if you(or the system you are using) are somehow deleting the cells that were originally referenced. This should be avoidable. You can clear the cells referenced instead of deleting them completely - then you won't get this error - and your formulas will remain intact. Now you can certainly use the formulas provided in the comments to hide the errors - but the root of your problem seems to me to be that the errors are occuring in the first place. Good Luck.

Resources