nested if and search and move help

Brad_Miller

Board Regular
Joined
Sep 18, 2014
Messages
56
Hi Excel geniuses

I am trying to sort my movies I have and I have them listed with a marker at the end of the file either [720p] or [1080p] or nothing

I have used these formulas to move the resolution tag to the front so I can group movies by resolution.

I used these serpeatly to move the tag but I get so loast trying to make them a nested if
=IF(SEARCH("[720p]",A1),CONCATENATE(RIGHT(A1,0),"[720p] ", LEFT(A1,FIND("[720p]",A1,1)-1)))
=IF(SEARCH("[1080p]",A9),CONCATENATE(RIGHT(A9,0),"[1080p] ", LEFT(A9,FIND("[1080p]",A9,1)-1)))

AND!
Ideally i would like to have one formula that move both tag and then if there is no tag leave it as is.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Original Name[/TD]
[TD]modified Name[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 274"]
<tbody>[TR]
[TD]13 Hours The Secret Soldiers of Benghazi (2016) [1080p][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 405"]
<tbody>[TR]
[TD][1080p] 13 Hours The Secret Soldiers of Benghazi (2016)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 274"]
<tbody>[TR]
[TD]16 Blocks (2006) [720p][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 405"]
<tbody>[TR]
[TD][720p] 16 Blocks (2006)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 274"]
<tbody>[TR]
[TD]200 MPH[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 274"]
<tbody>[TR]
[TD]200 MPH[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


Thanks in advance!
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello Brad,

Provided the resolution tag is always at the end of the movie name, this formula will place it at the beginning. The formula assumes the names start in "A1".

=IFERROR(REPLACE($A1&LEFT($A1,SEARCH("[",$A1,1)-1),1,SEARCH("[",$A1&LEFT($A1,SEARCH("[",$A1,1)-1),1)-1,""),$A1)
 
Upvote 0
A bit shorter...

In B1 enter and copy down:

=IFERROR(REPLACE(A1,1,FIND("[",A1)-1,"")&" "&LEFT(A1,FIND("[",A1)-1),A1)
 
Upvote 0
WOW - Ok now you guys are just showing off!

Now can you explain the formula in english? ;-)

[A] The REPLACE bit cuts off the target up to the first occurrence of [; the two consecutive & bits add a space to the result of [A] and the result of the LEFT bit that delivers A1 from the first char until [.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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