Changing format of table - excel

I am pulling data from a database application and the format the data is in is not what I want it to be. This is how the data is currently formatted:
This is how I want it to be:
How would I achieve this?

Assuming that your first cell "Nominal Date: 04/01/2021" is in cell B2, place this formula in cell A2:
=IF(LEFT(B2,14)="Nominal Date: ",DATE(RIGHT(B2,4),MID(RIGHT(B2,10),4,2),LEFT(RIGHT(B2,10),2)),A1)
Then:
drag it to the end of the list;
copy-paste the values;
delete column D (the one with the "Hol");
sort the list according to column B (the one with names);
search for the rows with nominal dates and delete them.
You can also record a macro while doing it. Then you can go into VBA, read the code, refine it and improve it. If something goes wrong and you can't make it work properly, try to identify the problem, search for a solution and if you can't come up with one, come back and ask another question. We will be glad to help.

Related

How to add running count to excel cell, which already has text in it?

Would anyone have advise on how to add running count to excel cells, which already have text in them, and without removing the said text.
Few screenshots will follow to clarify my issue.
I have received a ton of sheets which have a test case name as a text/string in the C column and they are missing a running count from the beginning of the cell (not sure if the "running count" is the correct term).
In the first screenshot you can see how I need them to be, as well as in the couple first rows of the second screenshot (column C). So the original text could be for example "Purchase order" and I want it to be "1. Purchase order" and the next cell would be "2. Purchase order" etc.
Screenshot 1.
Screenshot 2.
I imagine there isn't an already existing function in excel which would solve my problem. I have played around with macros and VBA some years ago, but don't have any clue from on top of my head how to solve this.
Perhaps a macro that would go through each cell from the selected column one by one, cut the existing text, add a variable number to the cell and then copy the cut text back there after the variable, then add +1 to the variable before moving to the next cell?
So I somewhat understand the logic how it could be done, but don't have any memory how the syntax and the operators etc. work in VBA.
Thank you in advance.
Not exactly sure what you want from the images, but you can do things like this:
If cell A1 has 942
and cell B1 has "slices of bread"
Then C1 can have the result "942 slices of bread":
=A1&" "&B1
Not sure neither if running count is the right term, but you can do it with a helper column and an easy formula:
=COUNTIF($C$2:C2;C2)&". "&C2
Then you can copy/paste as values and delete helper column

How to Return the First Column Header with a Non-Blank/Empty Cell

I have scoured the internet but come up empty.
I am looking for a formula that will be in a single cell (I don't want to have to fill it down the side of the table for instance) that will return the header of the first column that has a value in it, from left to right. If there's a value in the last cell of the first column, for instance, I want that header returned rather than moving to column 2.
I have tried nested xlookups and index/match combinations and just can't find anything that will be in a single cell.
Any help is appreciated!!
EDIT: Yup, let me be more clear. My apologies!
Here is an excerpt of my table. In this instance, I would want the result to be Sep-21 (a reference to the cell is also fine).
I know I can easily drag the formula in A1 down and pull the column header of the first cell in that row with a value. What I want is to reference this on another sheet, so I don't want to have to do that. I want one formula in one cell to pull this information, if possible. If I can't do it that simply, maybe I have to do some other wizardry and hide a row/column or something and fill the formula down that way and then pick the latest date, but I'd like to avoid that if possible. One cell would be much more elegant!
As for what I've tried, all my attempts are pretty messy and incomplete, so I don't know if it would be helpful to paste them here, but essentially I've tried to use an xlookup where the lookup_array is B2:D6, and then the return_array is the header, but that doesn't seem to work. I guess the lookup_array has to be a single column/row? Something like:
xlookup(ISBLANK(FALSE), B2:D6, B1:D1)
It's kind of like an inverse xlookup, lol.
EDIT2: I've done some more messing about and have come SO CLOSE! Now my problem is with structured references in a table and trying to exclude my first two columns.
First, the solution that does work without structured references (assuming the table starts in A1):
=IFERROR(INDEX(B1:D1,SUMPRODUCT(MIN(IF((B2:D6<>0)*(COLUMN(B2:D6)) > 0, ((B2:D6<>0)*(COLUMN(B2:D6)))))-COLUMN(A1))), "error")
But like I said, my structured references are getting in the way now. I want to pull all the data in my dynamic table, except for the first two columns.
I know this is a completely different problem now, my apologies for that.
The solution (assuming the table starts in A1):
=IFERROR(INDEX(B1:D1,SUMPRODUCT(MIN(IF((B2:D6<>0)*(COLUMN(B2:D6)) > 0, ((B2:D6<>0)*(COLUMN(B2:D6)))))-COLUMN(A1))), "error")
If your data is in row 2:
=INDEX(1:1, 1, MATCH("", 2:2,-1))
should work

How to fill in another table using a partial match to data in another table

I'm trying to fill in a table using data from another table. I've researched the VLOOKUP function, and either I don't fully understand it, or it isn't the right tool.
For example, let's say I have a column of data that is of the format: (p53, chk2, stra8-cre)
From this column, I want to extract any row (the entire row) that has 'chk2' in it. What tool can I use for this?
Thanks
From what I'm understanding, you're trying to have a formula in one cell that sets the content of all cells in its row. As far as I know, you can't do that without some sort of macro.
My suggestion would be to have a similar formula in each of the rows you want to set.
EDIT:
Use SEARCH to help with this problem. Look here on how to use it for this case.
Ex:
layout in CSV format:
p53chk2,a2,a3
chk2,b2,b3
stra8-cre,c3,c4
formula:
=IF(ISNUMBER(SEARCH("chk2",$A1)),B1,"")
Copy this formula across all cells in the row, and the contentshould be applied the subsequent cells.
Hope this helps, let me know if this isn't exactly what you were looking for.

Add cell values having particular text

First, I know that DSUM and SUMIF works with the values in the entire cell. I would like to know if I can add values of cells where part of the string contains a particular text.
Let me explain. I use Google Sheets to manage my expenses, and gather data about my financials. I have something like this—
As you can see, above is a typical example of a day. Each cell has a category, and a description, and below it, the value in the next row. Now is it possible to add values of the cell containing the word "TAXIS"? This way I should be able to get a sum of expenses for a particular category.
I've tried a vast number of expense managers, but none that I am happy with. Finally have decided to go the manual route, and here I am. Any help would be appreciated. Thanks in advance!
You can use wild card to add part of string. Suppose you data starts from C2 cell and data goes like your screenshot then you can use following formula.
=SUMIF(C2:K2,"*TAXIS*",C3:K3)
Obviously you have to customize formula based on your sheet from where data starts and ends.

How to do this lookup operation in Excel

There are two sheets (sheet1 & sheet2) in my Excel file, it's like daily work routine (entry date, pickup date, dispatch date). Some details will change as per the work flow and even new entries will appear.
I just need to compare both files if a change occurred in one cell it must have to show entire row of sheet1 (I can't specify exact headline for that all details are too precious and it has more than 100 headlines).
So if there is any formula for that please let me know like
IF+VLOOKUP
please correct below given formula
=If(RECHERCHEV(A2,sheet1!A8:FM264,1,FAUX)=(RECHERCHEV(A2,sheet2!A8:FM257,1,FAUX);"";RECHERCHEV(A2,sheet1!A8:FM264,1,FAUX))
It's the French version.
Try this array formula in cell A1 of sheet3 and drag across and down.
=IF(AND(EXACT(Sheet1!1:1,Sheet2!1:1)),"",Sheet1!A1)
Not really sure what you're looking to do here, and I don't speak french, but it looks like you have an extra parenthesis before your 2nd RECHERCHEV function.
Try this :
=If(RECHERCHEV(A2,sheet1!A8:FM264,1,FAUX)=RECHERCHEV(A2,sheet2!A8:FM257,1,FAUX);"";RECHERCHEV(A2,sheet1!A8:FM264,1,FAUX))
Though I'm not sure why the IF function uses semi-colons, but the RECHERCHEV uses commas, so maybe this:
=If(RECHERCHEV(A2,sheet1!A8:FM264,1,FAUX)=RECHERCHEV(A2,sheet2!A8:FM257,1,FAUX),"",RECHERCHEV(A2,sheet1!A8:FM264,1,FAUX))
Also it seems you want the entire row to update, so I am not sure how this vlookup would work since the arrays start in different rows than the lookup value.

Resources