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.
Related
I have a list with a column that did a lookup to another sheet in the workbook. The original formula looked like this: =VLOOKUP([#[Last Name]]&" "&[#[First Initial]],LookupLastF,9,FALSE).
Later the lookup column was moved, so I had to change the formula to lookup column 10 instead of 9: =VLOOKUP([#[Last Name]]&" "&[#[First Initial]],LookupLastF,10,FALSE). I had to manually copy the formula through the column, because there were exceptions -- i.e. some items overwrote the formula with manually entered values.
The problem is every time a new row is inserted into the table, the old formula is copied to the row instead of the corrected formula. So a default based on the original formula must still exist somewhere. How do I change it to the new formula?
You have to delete the content of the whole column and then (re-)apply the formula.
Mixing formula and static values within one column isn't a good idea.
Use three columns instead: calculated value, manual value, result value (where a formula shows the manual value if exists and if not the calculated value)
My SUMIFS formula criteria is based on a cell (say A1) that is data validated by list and changed via selection by user. If cell has data inside text or number by selection from drop down list, SUMIFS formula is considering that data as criteria to calculate the related sum. If criteria cell is left blank, I want formula to sum everything without any condition. My problem here; in criteria field of SUMIFS formula, I typed if condition like; SUMIFS(sum-range,criteria_range,IF(A1<>"",A1,"*")) but in this case excel considers only text values and do not include cells containing number. Briefly, if nothing selected in A1, I want SUMIFS formula to sum everything without any condition, numbers, texts and even blank cells. How can we proceed to do that?
EDIT:
Here an example for data and formula, what is expected is actually to disable criteria if one of selection is blank on left. Harun's suggestion works but if there is blank cell in criteria range, then in this case it won't consider those values in sum. For instance, if we select from left Phone/smart/touch, then how can we get "2" as output no matter what is in cri_range4 cells? Thanks
Example:
How about this solution? It basically ignores a missing entry in column C and evaluates only the other two. (Your example formula has a fourth criterium that isn't apparent in your list but the method can be extended for as many criteria as you might have.
=SUMPRODUCT((IF(LEN(C2),(INDEX(Lists,,1)=C2),TRUE))*(IF(LEN(C3),(INDEX(Lists,,2)=C3),TRUE))*(IF(LEN(C4),(INDEX(Lists,,3)=C4),TRUE))*SumRange)
For better readability I created a named range Lists which comprises your sample range E2:H10 while I named I2:I10 as SumRange'. INDEX(Lists,,1}` refers to the first column of the range. It's important that SumRange and Lists have the same number of rows.
If A1 is blank then just use not equal operator to sum all cells that are not blank. Try below.
=SUMIFS(D1:D5,C1:C5,IF(A1<>"",A1,"<>"))
Edit: can you check below formula in D3 cell then drag down.
=IF(C2="",SUM($I$2:$I$10),SUMPRODUCT(($E$2:$H$10=C2)*($I$2:$I$10)))
My problem:
I have the below tables:
In my second table (tbl_analysis), I need to create a formula in the Sum column that will sum the salary of a certain person over a certain period. When the period changes, the formula needs to be recalculated.
My try:
I started off by using the formula:
=SUM(my_range)
By the range can't be hard-coded, so I decided to find the cell address of the corresponding month as you can see in the range D12:E15
Formula in the cell D12:
=CELL("address",INDEX($A$2:$M$8,MATCH(A12,$A$2:$A$8,0),MATCH(B12,$A$2:$M$2,0)))
So when I tried to insert the above formula inside of the SUM formula like this:
=SUM(CELL("address",INDEX($A$2:$M$8,MATCH(A12,$A$2:$A$8,0),MATCH(B12,$A$2:$M$2,0)))
: CELL("address",INDEX($A$2:$M$8,MATCH(A12,$A$2:$A$8,0),MATCH(C12,$A$2:$M$2,0))))
And then Excel is referecing the cell address itself and not the address inside of the formula.
Skip the Addresses and use this based on the months:
=SUM(INDEX(A:M,MATCH(A12,A:A,0),MATCH(B12,$2:$2,0)):INDEX(A:M,MATCH(A12,A:A,0),MATCH(C12,$2:$2,0)))
Scott Craner has the right solution for this scenario and it makes more sense here. However if you would absolutely need to get cell reference from a cell you would be able to do it using the following function:
INDIRECT(cell)
Usually this isn't necessary but it can be handy when you want to break up a long formula where you would need to find a row number for example.
INDIRECT("A" & B2)
Where B2 has the row number for a dynamic range or specific moving target row.
INDIRECT function documentation
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!
I'm trying to apply conditional formatting to a column in Excel using the "Use a formula to determine which cells to format" feature.
In Sheet 1 have a list of names in column A with corresponding reference numbers in column B. In Sheet 2 I have a longer list of reference numbers in column C. I want the conditional formatting rule to look up the reference numbers in Sheet 1 against those in the Sheet 2 and highlight the cell where they is an overlap.
I have found an apparent solution to this using a vlookup as the formula:
=$B2=VLOOKUP($B2,Sheet2!$C:$C,1,FALSE)
This works in that cells in Sheet 1 have the correct formatting applied, but all the cells have been shifted up by one (image). I have copied the highlighted reference numbers out and done a lookup against the reference numbers in sheet 2 to double-check and the top one highlighted isn't in Sheet 2 but the one below the filled cells is (image).
I have tried replacing the vlookup in the conditional formatting with an INDEX/MATCH function in case there was a problem with the VLOOKUP but the result was the same: =$B2=INDEX(Sheet2!$C:$C,MATCH($B2,Sheet2!$C:$C,0))
I've tried removing the spaces between the xx and numbers in the references based on a different stackoverflow answer, but no luck. I've also tried changing the format of the cells from General to Text with the same result.
Any ideas would be appreciated!
You created this on the entire column B so the Applies to: is B:B. The formula references B2 but it is relatively referenced to B1. The highlights will always be applied to the cell one row below. Here are some solutions:
Change the Applies to: to =$B$2:INDEX($B:$B, MATCH("zzz", $A:$A)). This will resolve to the correct range and will not stay as a formula. You will need to have a look at the formula after you apply this to ensure that hte xlA1 references have not adjusted to teh new range.
Change the formula to ignore the first row. e.g. =AND(ROW()>1, ISNUMBER(MATCH($B1, SHeet2!$C:$C, 0))). No further adjustment should be necessary and the fuill column Applies to: is valid..
This should do the trick. Both the vlookup and the index match are throwing an error. Wrapping it in the iferror function should fix that.
=$B2=iferror(VLOOKUP($B2,Sheet2!$C:$C,1,FALSE),0)