Clear Cell contents depend on other cell content - excel

My first post here, maybe someone will be able to help.
I have a large Excel table with data from labs. Some results are below LOD And I need to remove them as I do not need them.
So basically I need to clear data in one cell, say E11, if data in D11 shows "<". Meaning below LOD.
If possible I would like to replace value in E11 with "-".
Is there any one who could help me please.

There are a few ways to go about this and you don't really need VBA.
Without VBA - Create a filter on your results and simply filter away the "<" - you could copy and paste this filtered table to another sheet
You could use a cell formula to help you identify results: =IF(A1="<","",B1) which would look at A1, if A1 was a < then it'd return nothing, otherwise it'll return value in cell B1.
With VBA - you'd basically be applying the same logic, just written in code. If you really want to do this, then look up how to do a loop first and how to use IF logic...

enter image description here
This is the worksheet I work with. I would like to clear all the values where < is next to them. This is just part of much bigger table.

Related

Copying formula from one row above in excel

I am new to excel and I am hoping if someone could help me with this challenge.
What I am trying to achieve is use a continuation formula from cell above if the cell to the left of current cell is not empty.
As you can see in the attached picture, the formula is copied down the row but the left cell is empty, I only want excel to apply formula if left cell is not empty,
I will really appreciate if you can help me please.
You can use ISBLANK and IF function together to check whether a cell is blank or not and give the value you want.
=IF(ISBLANK(A1), "", <put your original formula here>)
It is checking whether cell A1 is blank, then give nothing if it is true. If it is false (there is something in the cell), it will evaluate 3rd argument. So put your formula there.
You may want to look at some beginners tutorial first so that you can learn more about excel functions systematically.
check
https://support.office.com/en-us/article/IF-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2 and
https://support.office.com/en-us/article/IS-functions-0f2d7971-6019-40a0-a171-f2d869135665
to know more the IF adn ISBLANK function
Use =ISBLANK() to reliably test if a cell is actually empty.
The following is a table showing the results of applying various functions to a cell to test if is blank or is empty.
Column H contains the actual values being tested. Column I shows what is actually in the cells in column H. Columns D:G apply various formulas to test the contents of H.
Note that, somewhat a misnomer, =ISBLANK is the reliable way to test for an empty cell. =COUNTBLANK or IF(CELL.Value = "") are good ways to test for a blank cell.
I expanded on the example given by Colin Legg here
I hope i have used the term NullString appropriately,other users please feel free to correct me on that.

Copying cells from one worksheet to another if a column matches a value

I'm trying to use formula to copy data from one worksheet to another where a column matches a certain value.
To be more specific, I want Working!A2:E100 to contain Data!A2:E100 but only for those rows where Data!C2:100 contains the value "Fixed".
Doing this with leaving blank rows is simple, I just create the formula:
=IF(Data!$C2="Fixed", Data!A2, "")
And copy that formula across all the cells.
But then I thought I'd get clever and have it not copy across blank lines, and entered a maze of unclear excel tutorials and vague error messages.
I've created this formula:
=INDEX(Data!A2:Data!A200, MATCH("Fixed", Data!$C$1:Data!$C$200, 0))
And entered it as an array formula using ctrl shift enter.
However all I get is the contents of Data!A2 repeated over and over in every cell of my spreadsheet.
Does anyone need to know what I need to do to make this work?
This is my attempt at a local prototype following the example in BruceWayne's answer, the results are visible:
As you can see "Row 2" just appears repeatedly in the result column. Excel doesn't seem to have an easy way to see what version it is any more but this seems to be a pretty recent one, it's got the ribbon with the file menu and all menu headings are capitalized.
Here's a formula you can use (note: enter this as an array):
=IFERROR(INDEX(A$1:A$200,SMALL(IF(C$1:C$200="Fixed",ROW(A$1:A$200)-ROW(A$1)+1),ROWS(A$1:A1))),"")
You may need to tweak the ranges, I think I got them to match yours, but again, probably need to tweak. You can then drag this down, and it'll fill in with the values from column A, skipping any blanks.
Edit: Here's a screenshot to (hopefully) help show what I did:
You can edit the ranges, naturally, to be over two sheets.
To clarify, A$1:A$200 is the range of what you want to return (the index). C$1:C$200 is the range that holds "Fixed".

Easy One - reference to non-sequential cells

I'm sure this has been asked before, but I couldn't figure out the right search terms to get the answer I was seeking, so apologies...
I have one worksheet with regular but non-sequential data (i.e. values in A1, A11, A21...)
In another sheet, I want to be able to put in a formula to get the values from those cells, and have it be easily scalable so I can drag the formula down and continue to get every nth cell from Sheet1. It looks like OFFSET will work, but it's not that elegant. VBA seems like overkill...Is there a better way?
Thanks!
Either Offset like you said, or something like this would be on the other sheet in Row 1 and copied down (assuming the first sheet is called 'sheet1', or change to the actual name:
=INDIRECT(ADDRESS(ROW()*10-9,1,,,"sheet1"))
Offset would be even clearer:
=OFFSET(Sheet1!A1,((ROW())-1)*10-ROW()+1,0)

How do I use the result of one function in another function to get the value stored in a cell in another sheet in Excel?

In my current sheet I have some numbers in a column, which represent the row which I want to get the data from in another sheet. And I want to get it from the same column in which I am using the function...
I know using =Sheet1!A1 for instance gets me what is in A1 on Sheet1
and
=CONCATENATE("A",A1) being on sheet two, brings me back A + whatever value is stored in A1 on sheet number two... for simplicity let's say it's a one... so it would return A1
I am on Sheet2
I'm trying
=Sheet1!CONCATENATE("A", A1)
but the formula contains an error, I've tried rewriting this in many ways but it never works... any idea what the correct syntax I need is?
Greatly appreciated!
THanks
As Magicianeer said, you have to use the INDIRECT function. For your example:
=INDIRECT(CONCATENATE("Sheet1!","A",A1))
Should give the results you need.
However, it's a bit lengthy, and you can use & instead of CONCATENATE, and you can directly use Sheet1!A:
=INDIRECT("Sheet1!A"&A1)
What is evaluated in the brackets is Sheet1!A1, and INDIRECT converts this from text to a reference.
Try:
=CONCATENATE("A", Sheet1!A1)

How to look up information based off a single cell? In Excel

I've been working on VBA for so long I forgot how to do this...using formulas.
I have a cell that has a descriptor in it, in this case K1122121. The cell next to it, will be the description. On another sheet I have a list of parts, I need to look up said part number on sheet 2, and place the description next to the part it's looking up.
I know it's possible, I just forget how.
So to recap.
Sheet one has two cells, the first is a part number, the 2nd next to it, is where the formula is going, in this cell will produce the description to said part number.
Sheet two has part and description side by side. I need to reference the part number and find the description.
Once the description is found, place said description in the description field in sheet one.
Thanks for the help.
Here is a link of what I am working on. https://dl.dropbox.com/u/3327208/Excel/PAERTO.xlsm
It's called VLOOKUP and you call it like this:
=VLOOKUP(A1,Sheet2!A:B,2,FALSE)
Where:
A1 is the cell with the part number in sheet1
Sheet2 the sheet where the data is located (descriptor / description)
A:B is the range in sheet2 where the data is located
2 because what you are looking for is in the second column
FALSE to only get a value for exact matches - if no exact match is found, it will show an error
EDIT
Looking at your workbook, I would personally insert a new column in the jobs list (say between D and E) with a formula that only keeps the first word only - formula in E3:
=IF(ISERROR(FIND(" ",D3)),D3,LEFT(D3,FIND(" ",D3)-1))
Then the formula in the PAERTO sheet then becomes - formula in D20:
=VLOOKUP($E20,'Jobs List'!$E:$F,2,FALSE)
in the example you provided, I get a result for lines 20, 22 and 24, and an error on the other lines.
I can get a result if I use this formula:
=VLOOKUP(E20&" Rev"&F20,'Jobs List'!D:E,2,0)
However you need to change cell F20 to 4.
As long as part number and "Rev" are consistent between sheets, this formula should work.
Note that only cells D20 and D24 return values. The other part numbers don't exist on the other sheet, so regardless of what formula is used you will not see a return value.
With your part number in A1, in B1 the formula =VLOOKUP(A1,Sheet2!A:B,2,FALSE) will find the description
If you are on Excel 2003 or earlier, you will have to change Sheet2!A:B to be a full reference like Sheet2!A2:B2000
The answer was a little more complex than I was hoping, but I ended up using this as an answer. It may not be the most simplistic, or elegant, but it works.
=IF(E20=0,VLOOKUP("*"&E20&"*",'Jobs List'!D:E,2,FALSE),VLOOKUP("*"&E20&"*",'JL Archive'!D:E,2,FALSE))
I used the "*" to make it so that it utilized wild cards, something I never thought of using... but it works. I put the wildcard usage in front and behind so just in case any cells may have something more than the required text in the front of the part or behind it.
I hope this helps people. The original use for this was so I can use the formula can be used from another workbook, but as we all know this can be used anywhere. Enjoy :)

Resources