I am totally new to this kind of challenges and not sure any thing available ( not sure even on what base I have to search )
In the below excel sheet image the column 'A' has headings in two places ( row numbers 2,3 and 9,10) . The actual excel sheet has more than six thousand rows and too many sub headings like this ( If it is small file I can do it manually.. but more than 6 thousand rows)
The challenge :- I want to populate E column with "Make" value and F column with " Model" from sub headings . Can I write any rule or macro to populate these columns ? could some one help me ? Thanks for your help
Image Link
or below
Regards
Kiran
If you want to do this solely in Excel you can use the following. This assumes
All Headings are the same for "S.No"
Change the SUBSTITUTE clause to match the text for Make and Model eg I have used exact spacing of "Model: " and "Make : " to match the spreadsheet and substitute with ""
In cell G5 Enter =IF(ISNUMBER(A5),IF(ISERROR(FIND("Model",A3,1)),MAX($G$1:G4),MAX($G$1:G4)+1),"")
In cell F5 Enter =SUBSTITUTE(IF(ISNUMBER(A5),INDIRECT(ADDRESS(MATCH($G5,$G:$G,0)-2,COLUMN(A1),1)),""),"Model: ","")
In cell E5 Enter = =SUBSTITUTE(IF(ISNUMBER(A5),INDIRECT(ADDRESS(MATCH($G5,$G:$G,0)-3,COLUMN(A1),1)),""),"Make : ","")
Then drag down the formula in E5:G5 to wherever you need. However, I only recommend using this once only as the formulae will be slow to update over large ranges. Also if your headings are out of sync then VBA is the way forward
Related
I am writing a formula to run a matching analysis on some elements of a spreadsheet. The column containing the formula already has values filled in, but I need to run the formula on the blank cells. The formula is working but overwriting the current info I have within the filled cells.
I have tried a VBA code which got too complicated and did not work. With VBA I tried inserting the formula into only the blank spaces but was having some issues. I have also tried a basic excel formula.
=IF(COUNTIFS(A:A,A2,BU:BU,"CLOUD")=0,"Not Cloud",IF(COUNTIFS(A:A,A2,BU:BU,"NOT CLOUD")=0,"Cloud","Hybrid"))
VBA Code I tried:
If (IsEmpty(Bucket) Or Bucket = "" Or Bucket = vbNullString) And _
(GetCellValue(.Cells(i, "BU")) = "CLOUD") Then
Range("CC:CC").Formula = "=IF(COUNTIFS(A:A,A2,BU:BU,""CLOUD"")=0,"Not Cloud", _
IF(COUNTIFS(A:A,A2,BU:BU,"NOT CLOUD")=0,"Cloud"","Hybrid"))"
A reminder this is a high-level version
I want that formula to only run in the cells that do not have a value already in place. It should not overwrite the data from the VBA script that I previously ran before doing the formula. The disposition column should be completely full of values. The formula needs to run in only the blank cells.
You could achieve this with an additional column.
In the column to the right of Disposition (insert one if necessary) write the following formula (example for row 2, assuming Disposition is Column C):
=IF(C2=""; [Your formula here]; C2)
This will provide you with a column full of values, anytime you put a value into column C it will override the formula.
Edit: You can then copy this formula down the entire column to achieve the desired effect.
I am trying to record a Excel macro that will be conducting this action:
I have 2 worksheets. 'Worksheet' and 'Report 1'. The scenario I am seeking for is,
"If Report 1 AB column is blank, Worksheet F column will use the data in >Report 1 U column. If it has text, Worksheet F column will use data in Report 1 > AC column."
I have tried out different formulas. At first I used the whole column range as formula, putting blank as 0 and also trying " ". But the result I have is 0. I also tried to remove ranges and use one cell but it still does not work. So what is wrong with my formula?
=IF('Report 1'!AB5=" ", Worksheet!F6='Report 1'!AC5, Worksheet!F6='Report 1'!U5)
In the first place, is my formula even correctly structured if I want to achieve the scenario above?
As one of the other commenters mentioned, you're testing for a "space" by typing
" "
Instead, use
""
i.e. the two quotation marks with no character in between.
=IF('Report 1'!AB5="",'Report 1'!U5,'Report 1'!AC5)
Place above formula into cell F6 at sheet "Worksheet"
Please try.
edited answer below:
=IF('Report 1'!AB5="",'Report 1'!U5,'Report 1'!AC5)
if you have no text at all as your "blank".
=IF('Report 1'!AB5=0,'Report 1'!U5,'Report 1'!AC5)
if you want to set 0 as your "blank".
or... you can use both of it in 1 formula by using "or"
=IF(OR('REPORT 1'!AB5=0,'REPORT 1'!AB5=""),'REPORT 1'!U5,'REPORT 1'!AC5)
or...
=IF(ISBLANK('Report 1'!AB5),'Report 1'!U5,'Report 1'!AC5)
I have a table in Word, each row is a few lines of text (shift + enter).
When I copy the table to Excel every line of copy to my own line. You can copy (each line where it was used (shift + enter)) to one row in Excel?
My table in Word.
Copied table to Excel.
I want to Row1 Text - Row1 TextC was A1. I know I can merge, but I have a big table and looking for solutions, which will accelerate.
This isn't 'easy' presuming you're comfortable with excel you're going to need to either use the VBA environment or have a few additional columns.
One way would be to identify the 'top' and 'bottom' of each Row by; in column C (starting from C2, C1 is always "top") =if(left(c2,4)<>left(c2,1),"Top", if(left(c2,4)<>left(c3,4),"Bottom","middle"
Then in column D (and cell locking is important, also assumes it goes to row 100, you will need to change this)
if(or(C1={"bottom","middle"}),"",$A1 & " - " & index($A1:$A$100,match("bottom", $A1:$A$100,0)))
This will give you a list, with breaks in which you can either remove by copying and pasting column D to a new sheet as values, pressing F5 and removing blanks. The other way would be to remove duplicates from the pasted list, and then take out the blank wherever it appears.
There may be more efficient ways of doing this, but it's a pretty unique question!
Maudise
How do I copy and paste columns from Sheet 1 to Sheet 2 which has the word "To" in its column headers?
Example, Column H Header = 12/2/2014 To 14/2/2014
I want to copy only these types of columns and paste it on another sheet.
P.S. I'm looking for a non-vba solution (if there is one) so any help would be much appreciated.
I've tried using this formula but nothing happens.
=IF(COUNTIF(Sheet1!A$1,"*TO*"),Sheet1!A2,"")
P.S. I'm using Excel 2013.
You can use Find formula that will return the number of "To" for that.
=IFERROR(FIND("To", A1, 1), "Did not found")
And in VBA you can use InStr that does almost the same operation.
I have a large data file that has some broken rows from the extraction process. I'm trying to clean it up in excel and am running into an issue with multiple row checking. I could nest a set amount of IF statements in my formula but that runs the risk of missing values. A Sample of the data looks like this (The strings are pasted into Column A):
'ID_Value','last_name','first_name','','dob','gender'comment
comment
comment
comment'
'ID_Value','last_name','first_name','','dob','gender'comment'
'ID_Value','last_name','first_name','','dob','gender'comment'
'ID_Value','last_name','first_name','','dob','gender'comment
comment
comment
comment
comment'
I need to roll the comment rows into the normal row preceding them. Currently I can identify all the rows and can make it work when there are two comment rows but going beyond that I am at a loss.
Formula in Column B: =IF(LEFT(A1, 1) = "'", "IGNORE", "FLAG")
Formula in Column C: =(IF(B2 = "FLAG", IF(B1 = "FLAG", "MOVE")))
Formula in Column D: =IF(B2 = "FLAG", IF(B1 = "FLAG", IF(C2 = "MOVE", CONCATENATE(A1, A2))))
Any recommendations are greatly appreciated.
Here you go this should do it.
Download the spreadsheet here.
Spreadsheet Example
Paste your data into Sheet 1 Cell A1 and click the run_filter button.
Alternatively you can first run it with the dummy data that already present in Sheet1 and check to see that the results work as expected.
A couple of caveats.
The macro will stop When it encounter a blank cell in Column A. This is how I determine that the macro should end.
Comments should contain no more than 5 commas otherwise they'll be interpreted as real data.
A space character is added to comments.
The first row should not contain a comment.
A new worksheet called Filtered_Result will be created with the required result.
If you want to view the code click on the developer tab.
If it's not present See here for How to add it tab
Then Click the Macro Button.
Click the edit button on the macro combine_comments to see the code.
Give it a try and let me know how it goes.
Peter H