Skipping lines in Excel formula [closed] - excel

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have been attempting to figure out a formula to skip blank lines when I am referencing a list of parts for a bill of materials. The problem I've been running into is where the parts list is being held is updated based on what is selected and then transferred to the actual bill of materials there are blank spaces because some machines have more or less parts. I need to skip these and go to the next line and continue with the cells from there. So if I go from Cell if A1:A24 are filled and A25:A29 are blank and A30 has data I want to skip until it gets to A30 and continue on from there (A30:A35).

Let's pretend your data looks something like what's in column A, and the results you want are in column C:
In cell C2 and copied down is this formula:
=IF(ROW(C1)>ROWS($A$2:$A$11)-COUNTBLANK($A$2:$A$11),"",INDEX($A$2:$A$11,SMALL(INDEX(($A$2:$A$11<>"")*ROW($A$2:$A$11)-ROW($A$2)+1,),COUNTBLANK($A$2:$A$11)+ROW(C1))))
Adjust the $A$2:$A$11 to suit your data. Make sure that in the -ROW($A$2)+1 portion, the $A$2 is the first cell of your data, even it is blank (the point being that data could be there, and that it's not a header, and it's the first cell the formula should look at).

Within the loop that you use to hop from cell to cell, put your code within this if statement:
If Not IsEmpty(yourCell) Then 'yourCell needs to be replaced
'your code goes here
End If

Related

Excel without VBA: How to create a sequential number following pattern from a column [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have the following table:
I'd like to fill automatically the column with '001,002...' following the previous column. Please see the image to see the pattern (We'll have many in the future, it's crazy doing it manually)
I'm attching an example file: https://1drv.ms/x/s!Akmhm4db64ebrHQF9rlhwNUa7tdS?e=kUkFlV
Thank you!
Use TEXT and IF, like the following:
=TEXT(IF(A2<>A1,1,B1+1),"000")
Tested this formula in excel and it worked for me. Paste into cell B2 for your L4 code column and just copy down. As new items are added in column A, the pattern will repeat.
=IF(A2=A1,BASE(B1+1,10,3),BASE(1,10,3))
If you need to have it automatically populate to a predetermined row, drag the formula down (for example 1,000 rows) and use the following:
=IF(A2="","",IF(A2=A1,BASE(B1+1,10,3),BASE(1,10,3)))
Just for explanation purposes, what the formula is doing is looking at the previous item in column A and checking to see if it is the same as the current item, if yes, increment by 1, else start over at 1. The BASE function is adding the leading 0's.

excel: How do I run my VLookup formula only if certain criteria is met? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to create a formula that checks if there is a name above it before it returns a number from the table.
For example, when I put 4180 under PAUL in Cell D33; cells E33:I33 will show 200. In my example below, for Level 4, there isn't a name but a number is still showing in cell I38. I do not want it to display a number.
I tried to use Vlookup function, but do not know how to make cell blank when there is no name.
You can use the functions =IF and =ISTEXT OR =ISBLANK to check if a name is populated. If a name is populated you can have it run your Vlookup formula to pull the numbers from the table.
=If(ISTEXT(D2)=TRUE,VLOOKUP(.....),"")
Where D2 is referencing the cell above to check for a name and the Vlookup formula is to check your table.
This statement is saying if the above cell has text, run the Vlookup formula, if false, leave the cell blank.
Here are my results.
=If(ISTEXT(D2)=TRUE,VLOOKUP($C$3,$J$2:$O$5,2,FALSE),"")
enter image description here

Is there a function that can modify specific data that contains dashes in excel [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have data stored in an excel column, it is all 9 digit numbers where the last two digits are separated with a dash like in the following image:
Is there a function that allows me to delete the dash and the two digits after it?
Note: I have more than 1000 lines.
You can use either
1) Find and Replace (search your workbook for -* and leave the replace field blank). This will remove a dash and everything after it within your workbook. Note: * is a wildcard character and means it will find everything after a dash in a cell.
2) use the formula =LEFT(A1, LEN(A1)-3) to remove the last 3 characters (i.e. the dash and two numbers) from the left side of the cell A1. In my example the formula is for modifying the value in cell A1, you can just drag it down the whole column to do every cell in column A.
It would turn this: 1234567-89
Into this: 1234567
I would recommend option 2.
EDIT - Showing the working formula in Excel.
Provided that all data in that column follows the same pattern - i.e. a single dash in the entire data - then the following function will solve your problem:
=LEFT(A1,FIND("-",A1)-1)
It does not check for number formatting or anything fancy as the example indicates that not being necessary.
EDIT: This function obviously expects the data to be trimmed start in cell A1 and below. Copy the formula to cell B1, and then copy it to all further cells in column B as required.

Multiple cell referencing and average [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a student who's currently going through exams and to help revise I'm making a spreadsheet to keep track of all the marks I've got for questions in example questions.
REFER TO SCREENSHOT & SPREADSHEET DOWNLOAD
I need the average percentage correct to be calculated for each topic.
Download of the spreadsheet for you to test
Screenshot of the spreadsheet I've set up
Considering you already have the count of each question in column 'P' then that is helpful.
You can use SUMIF(G:G,O29,J:J)/P29 to calculate that percentage for each cell in column 'Q'. Once you enter that formula into that cell then simply drag it up and down to fill up all your desired cells in column 'Q'.
You may notice that you will run into a DIVISION BY ZERO error. You can avoid this by surrounding the SUMIF function with an IF function that will simply display a blank cell rather than try to calculate anything if the count of questions is ZERO.
EXAMPLE: IF(P29=0 , "" , sumif(...) )
Note: Once you auto drag the equation choose "fill without formatting" to keep your formatting clean.

Excel need to match and paste to an adjacent cell [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
So the formula needs to look at column D IN SHEET 1, go over to sheet 2, if it finds a match in column A, then paste the coordinates in column B into sheet 1 column E.IMAGE
As suggested by #Jeeped, you may use Excel Worksheet VLOOKUP() function: enter the following Formula into Cell "E2" of the first Worksheet("Sheet1"):
=VLOOKUP(D2,Sheet2!A:B,2,FALSE)
and extend it down to the last row with data in Column D. Hope this may help.
There are a couple of options on how to do it. As jeeped pointed out the VLOOKUP is a great choice for this layout. Alex's answer has the formula looking at the entire A and B column so you may want to edit that to match the rows of data you have. Another way of doing that automatically is
=vlookup(D2,offset(sheet2!$A$1,0,0,counta(sheet2!A:A),2),2,0)
Another method which could be more versatile if your data is layed out differently is:
=index(offset(sheet2!$A$1,0,1,counta(sheet2!A:A),1),match(D2,offset(sheet2!$A$1,0,0,counta(sheet2!A:A),1),0)-1)
Heck I think even the following would work in your case
=offset(sheet2!$A$1,match(D2,offset(sheet2!$A$1,0,0,counta(sheet2!A:A),1),0)-1,1,1,1)

Resources