What is the actual function to generate a single line output (Column I, #QR) from below fields?
+
A
B
C
D
E
F
G
H
I
1
f_name
l_name
designation
email
landline
mobile
country
web
#QR
2
John
DOE
Senior Manager
john.doe#gmail.com
4422688
444221
Sweden
google.com
BEGIN:VCARD\nVERSION:2.1\nFN:John Doe\nORG:Senior Manager - Google\nADR:Sweden\nTEL;WORK:4422688\nTEL;CELL:444221\nEMAIL:john.doe#gmail.com\nURL:google.lk\nEND:VCARD
There is a function "Textjoin" if you're using Excel 2019 or up:
=TEXTJOIN(" ",TRUE,A1:A2)
This would result into the string "f_nameJohn". You can look up more about this function here: https://support.microsoft.com/en-us/office/textjoin-function-357b449a-ec91-49d0-80c3-0e8fc845691c
You can also use:
=A2&B2
giving JohnDOE
Then you can do:
=A2&" "&B2
which will put a space between: John DOE
if you don't have Excel 2019 or up you can use:
=A2&" "&B2&" "&C2&" "&D2&" "&E2&" "&F2&" "&G2&" "&H2&" "&I2
or
=CONCATENATE(A2," ",B2," ",C2," ",D2," ",E2," ",F2," ",G2," ",H2," ",I2)
Related
Example of cells below. As you can see some cells have more info like emails, and some don't have a number but they're all in the same column.
Cell 1
Smith, James W
#129432
123 N. Street Road
Libertyville, IL, 60048
(810) 955-9721
claudie.predov#hotmail.com
Cell 2
Evette T Rudnick
#7928253
1308 Stutler Lane
Tidioute, PA, 16351
Cell 3
David C Ponce
#1234567
2855 Retreat Avenue
Frenchboro, ME, 04635
(313) 204-6364
Any help is appreciated. Thank you.
Use MID and SEARCH:
=IFERROR(MID(A1,SEARCH("(???) ???-????",A1),14),"")
Assuming I have the following cells:
A1 - first_Name (e.g Mary) B1 - last_name (e.g Thomas) C1 - car (e.g 3) D1 - houses (e.g 1) E1 - children (e.g blank)
I want to create a formula which can auto populate into the following sentence:
Mary Thomas has car=‘3’, House=‘1’,
All 3 of below equations build the exact same output seen in photo
Option 1 =CONCATENATE(A2," ",B2," has car= ",C2,", House= ",D2,", Children= ",E2)
Option 2 =TEXTJOIN(CHAR(32),1,A2:B2,"Has Car=",C2,",House=",D2,",Children=",E2)
Option 3 =A2&" "&B2&" Has Car= "&C2&", House= "&D2&" ,Children= "&E2
I am looking for some help with a formula. On my 'data' sheet, I have data in the format below:
A B C D E F G H I J
1 UID RecordType HCode AdmittedDate Forename Surname DOB Sex STDate RDate
2 87962 STAsses STIV1 01/01/2012 Mark Jones 13/07/1978 Male 09/12/2012
3 89658 Transfer GLSI2 01/01/2012 Alison Aitken 20/12/1956 Female 08/07/2013
4 84563 Discharge JHOP1 01/01/2012 David Beckham 09/08/1987 Male 08/07/2013
5 89654 STAsses STGE1 01/01/2012 Andrew Macbeth 27/09/1976 Male 08/07/2012
6 89867 Transfer KIND1 01/01/2012 George Deas 08/05/1989 Male 08/07/2013
7 87962 Transfer STIV1 01/01/2012 Mark Jones 13/07/1978 Male 04/03/2013
8 89654 Transfer STGE1 01/01/2012 Andrew Macbeth 27/09/1976 Male 12/08/2012
On my 'report' sheet, I have the following table set up:
B C D E F
4 HospCode RecordType Jul-12 Aug-12 Sep-12
5 STGE1 Assessments
6 Transfers
7 Discharges
8
I would like to do 2 things.
In D5, E5, F5, a formula is needed to return the number of 'STAssess' records for HCode 'STGE1' from the data sheet, which were completed in the month shown in D4 of the 'report' sheet (Jul-12). The dates for these records are in column I of the data sheet - 'STDate'.
I've tried using SUMPRODUCT which works to an extent, but I'm having difficulty bringing back records only completed in July. I need the formula to be dynamic in that it only brings back results for the month entered in D4 (so a date range built into the formula isn't doing the job).
In D5, E5, F5, I need to bring back the number of records from the 'data' sheet, which have 'Transfer' in column B (RecordType), 'STGE1' in column C (HCode) and a date in column J (RDate) which falls in the month specified on D4 of the 'report' sheet (Jul-12).
Anyone got any ideas? The data sheet is actually going to be an external .csv file which can't be manipulated. I don't mind using other hidden sheets to do any sorting that needs to be done, provided that this can be setup so that when the data is brought in, no extra work has to be done.
Thanks!
For both of your questions you can use COUNTIFS. It is easier to understand (for me) and compatible with Excel 2007 and newer.
First question:
=COUNTIFS(DATA!B:B,"STAsses",DATA!C:C,$B5,DATA!I:I,">="&D$4,DATA!I:I,"<"&DATE(YEAR(D4),MONTH(D4)+1,1))
Second question:
=COUNTIFS(DATA!B:B,"Transfer",DATA!C:C,$B5,DATA!J:J,">="&D$4,DATA!J:J,"<"&DATE(YEAR(D4),MONTH(D4)+1,1))
And these formulas can be dragged across your needed range.
Here is an example formula that you could use for the D5 cell, does that point you in the right direction?:
{=SUM(IF($B$2:$B$8=$B14,IF($C$2:$C$8=$A14,IF($D$2:$D$8=C$13,1,0),0),0))}
This is an array function so you must enter it without the {} at each end and use Ctrl + Shift + Enter to enter the formula.
If your summary table looks like
HospCode RecordType 12-Jul 12-Aug 12-Sep
STGE1 STAsses 1 0 0
STGE1 Transfer 0 1 0
STGE1 Discharges 0 0 0
And your data is in a table called Table1, then in D5
=SUMPRODUCT((Table1[HCode]=$B5)*(Table1[RecordType]=$C5)*(MONTH(Table1[STDate])=MONTH(D$4)))
I'm not sure what you mean by 'bring back', but assume you mean that you want to show it when RecordType = column C and when the RecordType = "Transfer" and the RDate is in the right month. Then
=SUMPRODUCT((Table1[HCode]=$B5)*(Table1[RecordType]=$C5)*(MONTH(Table1[STDate])=MONTH(D$4)))+SUMPRODUCT((Table1[HCode]=$B5)*(Table1[RecordType]="Transfer")*(MONTH(Table1[RDate])=MONTH(D$4)))
I would like to compare the latest date for each Name, and only print out the result without duplication of Name, one Name only with latest PurchaseDate and Type. Any method can be used?
Example:
Name PurchaseDate Type
Alex 10-3-2011 A
Alex 3-7-2014 B
Alex 25-12-2013 C
Jim 27-2-2014 C
Jim 1-10-2012 D
Jim 2-3-2013 A
.
.
.
Expected Result:
Name PurchaseDate Type
Alex 3-7-2014 B
Jim 27-2-2014 C
.
.
.
Sort by Name and Purchase Date Oldest to Newest, add this formula:
=IF(A2<>A3,"keep","")
(say in D2 and copied down), filter and for column D in the example, check "keep" then print.
I'm totally stuck on creating a user defined function in Excel VBA for the following problem. Any help would be greatly appreciated.
My excel file looks like this (only adding a small portion for the sake of brevity):
A B C D
1 Susan Reagan Smith
2 Jill L Taylor
3 Sarah Sullivan Williams
4 Roger J Lopez
I would like a function that determines: If A1 = Susan OR Jill OR Sarah, AND LEN (length of string) of B1 >1 THEN D1 = A1 /2 B1 C1 ELSE A1 /2 C1
So the output in column D would look like:
A B C D
1 Susan Reagan Smith Susan /2 Reagan Smith
2 Jill L Taylor Jill /2 Taylor
3 Sarah Sullivan Williams Sarah /2 Sullivan Williams
4 Roger J Lopez Roger /2 Lopez
I want to use VBA because I have many names to add and don't really want a huge formula in cell D1 with a lot of nested if statements. I've been working on it myself but it's just a mess and I'm too embarrassed to post it here. Thanks guys!
Public Function JoinNames(A, B, C)
If FirstNameMatches(A) And Len(B) > 1 Then
JoinNames = A & " /2 " & B & " " & C
Else
JoinNames = A & " /2 " & C
End If
End Function
Private Function FirstNameMatches(N) As Boolean
Select Case N
Case "Susan", "Jill", "Sarah"
FirstNameMatches = True
End Select
End Function
Have a list of names somewhere else on a sheet.
Use IF(ISNA(MATCH(A1, list_of_names, 0)), "Not found", "Found") to figure out if the name is recognized.