I have a stock list in excel - 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

Related

Excel - Auto populate a cell based on exact adjacent value (when having same names)

I´m trying to get a cell to return the exact value adjacent to the item I´m searching for.
Here is an example of excel work
When introducing the second, or third ¨10¨, I want the H and G columns to show me the values next to the second or third ¨10¨, not the first values.
So. when introducing the second ¨10¨ I want column H to bring up Bonnie M and column G to bring up 55555.
Or the third ¨10¨ to bring up $B6 and $C6.
If you are open to a solution with a support/help column in your data table, you may try the following solution.
Assume:
Range A2:A10 is named list_Num
Range B2:B10 is named list_Name
Range C2:C10 is named list_Serial
I have added a new column called Index in column D. In cell D2, enter the following formula and drag it down to D10:
=A2&"-"&COUNTIF($A$2:A2,A2)
Then I named Range D2:D10 as list_Index.
Replace the dropdown list in column I with list_Index
Lastly, enter the following formula in Cell G2 and H2 irrespecitvely:
In cell G2 enter
=IFERROR(INDEX(list_Serial,MATCH(I2,list_index,0)),"")
In cell H2 enter
=IFERROR(INDEX(list_Name,MATCH(I2,list_index,0)),"")
Drag down the formula to apply across as shown below:
Let me know if you have any questions.

filling excel column automatically where another column is not null

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)

How to compare cell against a set of cells and get an associated value

I need to compare the date of a cell against a column that has multiple date and I see which one it matches and get the associated value. Here I put an image to explain myself better:
Column D is where I need to put the formula, which compares the dates in column A on sheet 1 with the dates in column A on sheet 2. If it matches, I need to multiply the values in column C on sheet 1 by the values in column B of sheet 2.
Here another image with an example to be clearer
I have a little idea that would be something like:
= YES (ERROR (MATCH (Sheet1! A4; Sheet2! A2: A32; 0)); Sheet1! C4 * X
In the x it should go B3, but I don't know how to get that cell in the search above.
Try this:
=VLOOKUP(A3,sheet2!A:B,2)*C3
I have recreated your spreadsheets below.

How to refer to multiple adjacent cells

I have a work sheet in which there are several cells with a specific entry - let's say "A". These are not all in the same rows/columns. After each cell is a date.
I need to count the number of cells containing "A" which also have a specific date in the cell immediately to its right. I've tried combinations of Countifs and Indirect, with no success. How can I achieve this?
This counts the number of times that there is A in column A and 1 in column B
=SUMPRODUCT(($A$1:$A$5="A")*($B$1:$B$5=1))
This outputs in cell D1
Not too difficult.
I have created a sample sheet with 8 rows and 5 columns of data.
See below, the formula in cell C12 counts the number of occurrences where the a cell with a date of October 31, 2017 is directly to the right of a cell that contains the text A.
If you want more info as to how this works, read on:
When searching for cells that contain A, you don't search in the last column of the data (in this case, column E) because it is impossible for a column to the right to have any date in it. This is why a portion of the formula says A1:D8="A" instead of A1:E8="A". This is the same reasoning why we start searching for a date in column B rather than column A in the formula.
You can achieve this with a helper row. Add additional row on top of your Worksheet. In cell "A1" enter formula below.
=COUNTIFS(A2:A2000,"A",B2:B2000,"YourDate")
Drag this formula to the rightmost of where you have data, then simply sum all values returned by formula.

A formula to Find/Replace mobile telephone numbers in text format

I have a column where I input mobile telephone numbers. Here's sample input for Column A (text format):
+639154112315
+639171214125
+639179120519
I have a column (B) where I input mobile numbers (text format) that are for removal e.g.:
+639171214125
So Column C should display:
+639154112315
+639179120519
In Cell C I want to display the mobile numbers from Cell A but not any numbers from Cell B. I tried VLOOKUP and it doesn't work (for Cell C):
=IF(ISNA(VLOOKUP(B2,A:A,1,FALSE)),"",A2)
Is this possible in Excel?
Taking a guess that by Cell you mean Column, the following (copied down as appropriate) might suit;
=IF(IFERROR(MATCH(A1,B:B,0)=0,A1),A1,"")
Edit If you had merely wished to identify in ColumnA those not present in ColumnB Conditional Formatting might suit, with a formula such as =ISNA(MATCH(A1,B:B,0)>0).
You may want to post a data sample. Does column B have the actual numbers? Or a flag to remove the number of the same row?
Consider:
To build a contiguous list of numbers to be removed, add a helper column with the formula
=IF(ISBLANK(B2),"",ROW())
in cell C2 and copy down. Then enter this formula into cell D2:
=IFERROR(INDEX(A:A,SMALL(C:C,ROW(A1))),"")
Copy down. The result is:
In this setup, it does not really matter what the values in column B are. It can be a "yes" or a "delete" or the actual phone number. The important bit is that the cells in column B are either empty or have a value (any value).

Resources