So I am populating a spreadsheet with a copy n paste of my banking transactions. I want excel to populate a cell 10 to the left of it with that specific costs cost centre number.
Eg, Petrol has a cost centre number of 10
I copy and paste my bank statement in, the sheet sees all the cells containing 'petrol' and populates the cell ten to the left with a 10
I do not want to do this with a formula, I want to put it in vba.
Can someone help please?
Thanks in advance
You can use the following code to copy a value ten cells to the left.
Cells(Row,Column).Value = Cells(Row,Column + 10).Value
To get the values for 'Row' and 'Column', you can use the find function to find the address for 'petrol' and all the other values that you want.
My Workbook has three sheets: "Wire Sheet", "Paste Data" sheet and "Wire instructions"
I need the "Wire sheet to dynamically populate with the data from the other two sheets based on certain conditions, i.e. date and data from that date.
I am using the index, match address functions to find the names from the "paste data" tab based on a specific but I can't figure out how to put a condition in there to only return names that are "buys"...
Here are my formulas:
This is just to find the cell:
S17= =MAX(IF('Paste Data'!B:B = 'Wire Sheet'!K2, ROW('Paste Data'!B:B) - ROW(INDEX('Paste Data'!B:B,1,1))+1))
S18= =ADDRESS(MATCH(K2,'Paste Data'!B:B,0),2,3,1,"Paste Data")&":"&ADDRESS(S17,5,3,1)
S19= =INDEX(S18,1)
here is the formula i am using to return the data:
=IF(INDEX(INDIRECT(S19),1,4)=0,"",INDEX(INDIRECT(S19),1,4))
Example on how spreadsheet works:
Currently: if you place a specific date in cell K2 on the "wire sheet", the boxes (cells A18:O67) populate with the data from the other two sheets based on that specific date. The data coded "Sell" is being populated in the boxes on the wire sheet, but should not be.. here is an example:
For example: If you place the date 7/13/2018 in K2 cell, the cell B57 is populated with letters SCR, which shouldn't be the case, as if you go to the "paste data" sheet, this is a "sell".
enter image description here
Then if you place the date 7/16/2018 in K2 Cell -- the cell B18 is doing the same thing, its populated with WQ when it shouldn't be, as it is a "sell", on the "paste Data" sheet. I would like it to just skip over this row of data and go and find the next row that is coded "buy"..
enter image description here
I just want to place the data that are "buys", on the wire sheet. All the sells should be passed over. I am not sure how else to explain this, which might be part of the issue.
enter image description here
Thanks in advance.
https://my.pcloud.com/publink/show?code=XZNzcB7ZpIigcTAabUz2vpPaXQ4nSVUfdc2X
+-----[editRevision2]----+
My way :
Y5 =COUNTIF('Paste Data'!B:B,'Wire Sheet'!K2)
Z6 =IF((ROW(Z6)-5)<=Y$5,ROW(Z6)-5,"")
AA6 =INDEX('Paste Data'!F:F,MATCH('Wire Sheet'!$K$2,'Paste Data'!B:B,0)+'Wire Sheet'!Z6-1,1)
AB6 =IF(AA6="Buy",AB5+1,AB5)
AC6 =IF(AA6="Buy",INDEX('Paste Data'!E:E,MATCH('Wire Sheet'!$K$2,'Paste Data'!B:B,0)+'Wire Sheet'!Z6-1),"")
AD6 =IF(AA6="Buy",INDEX('Paste Data'!K:K,MATCH('Wire Sheet'!$K$2,'Paste Data'!B:B,0)+'Wire Sheet'!Z6-1),"")
select Z6:AD6 and extend to D15, then
B18 =IFERROR(INDEX($AC:$AC,MATCH(A18,$AB:$AB,0)),"")
E19 =IFERROR(INDEX($AD:$AD,MATCH(A18,$AB:$AB,0)),"")
copy B18 to J18, B31, J31 ...
and copy E20 to J20, B33, J33 ...
+-----[ProviousEdit]----+
Make
B18 =if(SUMIFS('Paste Data'!$K:$K,'Paste Data'!$E:$E,IF(INDEX(INDIRECT(S19),1,4)=0,"",INDEX(INDIRECT(S19),1,4)),'Paste Data'!$B:$B,$K$2,'Paste Data'!$F:$F,"Buy")=0,"",IF(INDEX(INDIRECT(S19),1,4)=0,"",INDEX(INDIRECT(S19),1,4)))
and adjust the INDEX(INDIRECT(S19),1,4) accordingly for J18,B31,J31 ...
Hope that solves.. (:
new to the forum and new to Excel in general. My buddies and I are creating a golf stats sheet and we wanted to see if there is a formula to pull specific data from specific values. Here is the example:
Sheet 1(Totals)
Sheet 2(Course 1)
Sheet 3(Course 2)
etc.
The Totals sheet will provide the list of players in Rows and in the first column will be Course names that can be selected as a List.
The other sheets (courses) will basically have score cards for that course. It'll inidicate names of who played that course along with course scores in a specific cell. i.e. Cell A1 would have the player name and B1 would have the total score.
What i would like is a formula in which, once a specific Course is selected in the Totals sheet, it'll return the specific player with its score.
So if i were to select Course 1 (Cell A1) in a drop down menu, the formula would look in the workbook and find the name Course 1 and return the player name is Cell B1 with the score in Cell C1.
I hope this didn't confuse anyone.
Assuming players are in A2 and down and the course name is in B1. Put this in B2 and drag.
=VLOOKUP(A2,INDIRECT("'"&B$1&"'!A:B"),2,FALSE)
Chart Example
Hello All,
I am looking for some help in cleaning up an organizational chart that I have in excel. Right now, there are many duplicates as the linked picture shows. I need to remove all the duplicates, and shift the unique values over into the blank spaces
(i.e., Bill G, Bill G, Fred K, Fred K, Joe X ---> Bill G, Fred K, Joe X).
I have been trying to get it done using Excel Formulas (=IF(A1=B1, B1, A1)), but it does not repeat correctly across the Sheet, especially because the different rows have varying numbers of occupied columns.
I'd appreciate any help that I can get. Thank you!
No need for VBA. Use Data, Advanced filter, choose Copy to another location and check Unique records only
Select your range
Go to the Data tab
In the Data Tools pane, select "Remove Duplicates"
first a formula to bring unique only. the formula display duplicates as 0.
then while still selecting the formula range, open the "go to special" dialog box
select Formulas > Numbers
all formula output zeros will be selected
press `Ctrl + minus(-) to delete cells, select "shift cells left"
end result
I have two different excel sheet first sheet contain some country list and second sheet is blank. There is a dropdown column with every country which contain 'Yes' 'No'. When I select yes I want that, the selected country row will automatically add to second sheet with all data. When I select more country they will dynamically insert/add to second sheet with maintaining country order in the first sheet.
These can be done with macro but I want to do this with formula.
Try this:
=IFERROR(INDEX(Sheet1!$A$1:$C$7,SMALL(IF(Sheet1!$D$1:$D$7="Yes",ROW(Sheet1!$D$1:$D$7),1E+99),ROW($A1)),COLUMN(A$1)),"")
Input formula in Cell A2 of Sheet2 and press Ctrl+Shift+Enter.
Then copy to remaining cells. Adjust the addresses in the formula to suit. HTH
Result: