Creating a Formula to TextJoin

Shazir

Banned - Rules violations
Joined
Jul 28, 2020
Messages
94
Office Version
  1. 365
Platform
  1. Windows
Hi, I hope you all are doing well.

I was looking for a formula that will solve the below picture Example.

I want to get the Cells in "Late" Column if C2,D2,E2 have such format "Late - 11:00 AM" then "Late" should be converted with Date as available in C1,D1,E1 and time should be as it is.

and result would be as = 8/1/2020 - 11:00 AM



1598524889692.png
 
Thank you so much for your help.
Sir, Peter_SSs
=ARRAYFORMULA(TEXTJOIN(", ",TRUE,IF(LEFT(C2:AG2,4)="Late",TEXT(C$1:AG$1+RIGHT(C2:AG2,8),"mm/dd/yyyy - (hh:mm AM/PM)"),"")) )

Above formula is working perfectly for single status that is “Late”, “Early” ……etc.

But there will be on or more status in cell “C2” then formula will show wrong values.Requesting you to please review this formula and make further changes to make it perfect I want result attached in below picture from Column “C” as available in Column “AI:AN” looking for your respected response.


1598637344437.png
 
Last edited:
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
As I pointed out earlier, Peter's suggestion would have been based on the information that you provided in your original post.
It is wise to make sure that the information is complete and that you are not going to make any significant changes to it before asking for formulas that refer to it.

Try array confirming this in AI2, then drag right and fill down.

=TEXTJOIN(", ",TRUE,IFERROR(TEXT($C$1:$AG$1+MID($C2:$AG2,SEARCH($C2:$AG2,AI$1)+LEN(AI$1)+3,8),"mm/dd/yyyy - (hh:mm AM/PM)"),""))
 
Upvote 0
I understand that.

but even after confirming the array its result is empty.

1598638153236.png
 
Upvote 0
I can see from that screen capture that you have not confirmed the array.
 
Upvote 0
Oops, I had to check it 4 times to find my mistake, try this version instead.

=TEXTJOIN(", ",TRUE,IFERROR(TEXT($C$1:$AG$1+MID($C2:$AG2,SEARCH(AI$1,$C2:$AG2)+LEN(AI$1)+3,8),"mm/dd/yyyy - (hh:mm AM/PM)"),""))
 
Upvote 0
[B]jasonb75[/B] Thank you so much for making this unbelievable formula you are literally a PRO Thanks.

But it should not mention the time with "Absent" and "Extra Shift"

As you can see in attached picture

1598640959011.png
 
Upvote 0
See if this works, array confirm in AK2 then drag and fill columns AK and AL.

=TEXTJOIN(", ",TRUE,IFERROR(TEXT($C$1:$AG$1+MID($C2:$AG2,SEARCH(AK$1,$C2:$AG2)+LEN(AK$1)+3,8),"mm/dd/yyyy"),""))
 
Upvote 0
jasonb75

I just wanted to say a BIG THANK YOU to you for putting in so much effort. You deserve 5-Stars. Thank you.
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,841
Members
449,193
Latest member
MikeVol

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top