Excel Formula - VLOOKUP leave blank if no lookup value - excel

I have an excel spreadsheet in which the VLOOKUP process I'm trying to do is getting more convoluted, but I'd like to try to see if this is possible.
I have the following formula:
=IFERROR(VLOOKUP(A2,DataTable,4,FALSE),"Value Not Found")
This works perfectly for looking up a set of data by pasting the values into column A. This looks to see if the value is found in the table called "DataTable" and returns the value in the 4th index.
What I'm now trying to do is paste this formula all the way down the excel spreadsheet. However, this results in every cell to say "Value Not Found" even though there is no lookup value in column A. Is there a way to alter this formula to leave the cell blank if the respective cell in column A is blank?
Thanks,

use:
=IF(A2="","",IFERROR(VLOOKUP(A2,DataTable,4,FALSE),"Value Not Found"))

Related

Excel vlookup matching on last column and return row

In excel I have a table on sheet 1:
Within sheet 2 I want to do something like a vlookup which looks for 'not done'in the status column and if found then the whole row is shown in sheet 2. Also an added complication is that I would prefer not to have gaps i.e. for any rows showing 'done' as below:
As I state above I have been trying with VLOOKUP and CHOOSE but I cant get anything to work. Can anyone suggest some ideas?
You can use a CSE formula (entered with CTRL+SHIFT+ENTER).
If your data is in A1:C7 (including header row), you can put this in E2 and drag right and down:
=INDEX(A$2:A$7,SMALL(IF($C$2:$C$7="not done",ROW(A$2:A$7)-ROW(A$2)+1),ROWS(A$2:A2)))
Wrap that in IFERROR([formula above],"") to hide #NUM errors when it runs out of results.

Multiply rows with other rows and return total value

I am working on a crypto tracking sheet.
I have a datatable with a column referencing values from another sheet's datatable with a INDEX formula.
I need each column's rows multiplied by the USD Price column and then return the total value at the bottom of each column.
I tried with another INDEX formula but it is giving me an error. Is it because I am trying to INDEX a cell which contains a INDEX formula?
Here's a link to my Excel sheet with the formulas, you will find my attempt at the bottom of the sheet. It returns #VALUE! error.
https://1drv.ms/x/s!AocHOUIO1meDklmoEZkC53Zg6Z3S
Here is a screenshot if you prefer not to click on my OneDrive link.
There are a couple of issues with the formula you are trying to use, the foremost being that even when working correctly, it will not give you the results you are looking for. If you change your formula from
=SUM([Yobit]*INDEX(CMC_Prices[Coin.price_usd],MATCH([Coin Symbol],CMC_Prices[Coin.symbol],0)))
to
=SUM([Yobit])*INDEX(CMC_Prices[Coin.price_usd],MATCH([Coin Symbol],CMC_Prices[Coin.symbol],0))
then hold CTRL+SHIFT and press ENTER, you will get a result, but it isn't the correct result for what you're trying to accomplish, as it will SUM the Yobit column, and multiply it by the first value returned by the INDEX/MATCH, which is the value for the ABY Coin only.
Here is what I ended up doing to get the correct result:
First of all, your USD Price column is already pulling the values you're trying to INDEX/MATCH with that formula, so you don't need it in the formula, as it won't actually INDEX/MATCH each row as you want it to.
Secondly, it isn't formatted as a number, and changing the format doesn't seem to help at all (to see this, try testing the formula =M2+M3 against the formula =SUM(M2:M3) to see what I mean). You can fix this by simply adding *1 to the end of the formulas in column M, or typing a 1 into a cell, and pasting special using the "Multiply" operation into the M column.
Once that is done, you can achieve what you want with an array formula (which is simply a formula that applies to all cells in a range). In your "Totals" row, type this formula:
=SUM(IF(CoinsAssets[Yobit]="", 0, CoinsAssets[Yobit]*CoinsAssets[USD Price]))
Then hold CTRL+SHIFT and press ENTER. You should see this in the formula bar now:
{=SUM(IF(CoinsAssets[Yobit]="", 0, CoinsAssets[Yobit]*CoinsAssets[USD Price]))}
This will give you the correct calculation for each of these you are wanting.
Hope this is helpful!

Leave referencing cell blank if referenced cell is blank but has a formula

I've searched through so many forums on here to find exactly what I'm looking for but haven't found what I needed.
Basically I have a workbook with cells that reference another workbook. Column A cells fill the date from the other workbook as does column B. I'd like for cells in column C to have an "X" if the cell in column A has actual data in it and left blank if it does not. The problem I'm running into is that Excel is putting an "X" in all of the cells in column C because it's reading that Cell A has a formula in it to pull the data from the other workbook.
Current formula: =IF(OR(ISBLANK(A5>"")),"","X")
I've tried isblank, not, etc, nothing seems to be working. Below is an example of what it's doing:
The problem
What I want
The OR() function typically works with more than one condition. You want to see if either A or B is blank, but you only test for A.
IsBlank() returns true if a cell is blank. You only need to pass it a cell, nothing else. You are using a cell compared to a blank string as the argument, which is not correct syntax.
Try this:
=IF(OR(A5="",B5=""),"","X")
On the other hand, pre-filling a column with a formula is not good data architecture. You can turn the data into an Excel Table object with Insert > Table and enter the formula for the existing rows of the table. Then the formula will automatically be applied to new rows that are added or inserted.

Vlookup error thrown when trying to delete the columns

I had used vlookup for matching the column values. However after vlookup i dont need the column used for vlookup. But when i tried to delete the column the vlookup column value changed to #REF!. How should i achieve without affecting the matched data? I had tried to copy to another excel sheet but doesnt work. Any idea pls?
So you are saying you have a column (A) that is doing a vlookup on another column (B). You want to delete column B but have the results of the vlookup remain in column A.. Can be achieved by copy pasting the results in column A as values before you delete column B. So perform the vlookup, select the cells with the results, copy then click paste special and choose values

Filling down a VLOOKUP formula without changing the range

I am comparing values in a row in one sheet to values in another row in another sheet. The following formula and works:
=IFERROR(VLOOKUP(A1,Sheet1!A1:A19240,1,FALSE),"No Match")
My problem is when I fill down the formula, it increments A1 correctly but also increments the (A1:A19240), so half way down I have narrowed the search field.
How can I apply this formula to a column?
Change A1:A19240 to A$1:A$19240, i.e. apply:
=IFERROR(VLOOKUP(A1,Sheet1!A$1:A$19240,1,FALSE),"No Match")
This is called using absolute references.

Resources