filling excel column automatically where another column is not null - excel

I want to fill an excel column with a specific value where another column in the same sheet is not null(I've used '-' for all the empty cells). Can I automate this?
For example, in the screenshot, where ever I have a value, I want to insert 'Hi' (Only at the places with a value) and omit where there is blank space represented by '-'. Also, it should not edit the values in B column if there is anything already present in it.

You can use if function to do this task. Suppose you have data to test in Cell A1 then you can enter Formula in cell B1 as =if(A1<>"-","Hi","") this means if Data in cell A1 is not - then enter Hi in cell B1 else keep B1 empty. See Screenshot attached.

You can do the following: suppose column A is full of values and you want to fill column B with "-". First, write the value "-" in the cell "C1", then select column B and write in B1 =$C$1 and then press Ctrl+Enter Key that's it

=IFERROR(IF(B1="","-",COUNTBLANK(INDIRECT("B1:B"&ROW()-1))+1),1)
Or avoiding INDIRECT:
=IFERROR(IF(B1="","-",SUM(IF(INDEX(B:B,SEQUENCE(ROW()-1))="",1))+1),1)

Related

excel: list all values of a column of a range based on a condition

I have a range in a Excel Sheet table that contains 2 columns like A and B.
I want to list in another column all values from column A if the corresponding value in column B is not null.
I know a way to do it, but it produces a lot of "empty raws" like in column C
=if(B<>"";A;"")
I would like to do it in a compact way, with no "empty raws" like in column D
Here is an example for data down to row #19. In C1 enter the array formula:
=IFERROR(INDEX($A$1:$A$19,SMALL(IF($B$1:$B$19<>"",ROW($B$1:$B$19)),ROW(1:1))),"")
and copy downwards. (You may need to use semi-colons in place of commas)
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.

Identify minimum and maximum values based on 3 criteria

In the table shown, I need a formula for column D that will indicate the first date (minimum) and most recent date (maximum) that each participant (in column A) took survey A (in column C). Column D would need to indicate "first" and "last" tied to the Participant ID--for example, I would want D2 to populate with "3Last" and D5 to populate with "3First." Column E displays what I would need column D to display. If it's not a first or last date (something in between), or if it's not survey A, the cell in column D would be left blank or 0. If there is only one date that meets the criteria, it should return "First" rather than "Last." I'm pretty stumped on this one... Any help is much appreciated!
In E2, insert the ARRAY formula listed below. If you have never used an array formula, follow these steps:
select the formula from this page
copy it
go to excel
select cell E2,
press the 'F2' key
paste the formula
press CTRL+SHIFT+Enter (instead of just pressing enter)
To copy down, follow these steps:
Copy cell E2
Move down to cell E3 (instead of selecting a range)
Paste in cell E3
Select your range and paste from there.
If you don't copy down in this manner, it will tell you that you cannot change the array...
=IF($C2="A",IF($B2=MIN(IF(($C$2:$C$7=$C2)*($A$2:$A$7=$A2),$B$2:$B$7)),CONCATENATE($A2,"Last"),IF($B2=MAX(IF(($C$2:$C$7=$C2)*($A$2:$A$7=$A2),$B$2:$B$7)),CONCATENATE($A2,"First"))),0)
HTH

Identify which cell in a row contains a specific text

I have a column compromising of text, I would like to search through that entire column to identify in which cell does the contents contain text that I am searching for.
Snip of the excel data
I need to search for the text in the first column and identify which cell in the final column contains the data I am searching for.
You use this formula,
=IfError(VLOOKUP (A2, A2:D25, 3,False),"")
This formula will search for value match with A2 in data range A2:D25, in Column 3 means in C,, if find pull the match otherwise return a Blank. U can write "Value not found" within quotes also.
Use the formula in some column , say I,
=IF(ISERROR(FIND($A$1,F1,1)),"",F1)
Drag down till the end of list. This will return what all matches A1 with column F. If you want to search for A2, change the formula to A2 and do the same. This cannot be done for all columns in A with all columns with F as there is a chance that the same string can be found in one or more cells in F.

I have a stock list in excel

I have a stock list in excel. I'm using a formula =IF(E7=0,"-",D6+B7+C7-E7) which is fine as long as I enter a number in cell E7 but I need to get the calculation when I enter a value in B7 and/or C7. The formula is in cell D7 but I don't want formula results to be displayed in the cells below until there are more entries. Can you help please?
Instead of returning a dash, you could return an empty String. For example:
=IF(E7=0,"",D6+B7+C7-E7)
This will not display anything in a particular row in column D until there is a value in the corresponding row in column E.
I suggest you input an "Original Stock" column in B to account for the numers that don't add up in your example:
In that case, this formula should do the trick:
=IF(AND(B2=0,C2=0,D2=0,F2=0),"",B2+C2+D2-F2)
It checks to see if colums B and C and D and F are empty and outputs an empty cell if they are. Otherwise, you get the current stock from these cells.
Is this close to what you wanted to achieve?
You can download my test file
here

Excel logical statement

I want to accomplish a certain task in excel.
I want to practice 10 key skills.
I have typed numbers in column A(cells, A1,A2,A3,etc.). I want to retype them in column B. Then (if column B matches column A) would like to have the word "OK" appear in column c. Can write the simple IF statement for A1=B1. Do not know how to make the statement automatically apply to other cells(i.e if A2=B2, A3 =B3, etc).
Thanks. CD
In cell 'C1'
=If(A1=B1,"OK", "")
Now drag this cell down col C until your last row. Excel will auto increment A1 & B1 to A2 & B2 and so on... unless you use absolute referencing which is the dollar sign like this $A$1 for example.

Resources