LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Andrea Jones
 
Posts: n/a
Default Beginner seeks help with IF statement

You can do this with embedded IFs and text functions like LEN and MID to take
the 'son of' part out of the string. Your formula in P1 would be something
like:

=IF(MID(L1,1,3)="son","so",IF(MID(L1,1,4)="wife"," wi",IF(MID(L1,1,3)="dau","da","")))

The formula to use in Q1 would then be

=IF(OR(B2="so",B2="da"),MID(A2,8,LEN(A2)-7),IF(B2="wi",MID(A2,9,LEN(A2)-8),""))

Andrea Jones

"Ian" wrote:

Can anyone help me with the following please.

I have a spreadsheet that has textual data in one column describing the
relationship of the person, for example "son of John". What I want to
be able to do is process all the rows for this particular column as
follows:

If a cell in column L contains the fields "son of", "dau of" or "wife
of" I want the cell in column P to have inserted "so", "da" or "wi"
respectively. Then I would want column Q to have inserted the name of
the person to whom they are related and then finally the original cell
to be emptied.

So, the following:

Before
L1: son of John Henry

After
L1:
P1: so
Q1: John Henry


and


Before
L1: wife of William

After
L1:
P1: wi
Q1: William


and


Before
L1: dau of George Herbert

After
L1:
P1: da
Q1: George Herbert


Any help would be much appreciated.

Ian



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to calculate a sum as one outcome of an IF statement barb in NC Excel Worksheet Functions 2 March 31st 05 08:01 PM
What statement to use? Paul Excel Worksheet Functions 6 February 13th 05 05:23 PM
How do I fix a circular reference in a financial statement? drjayhawk25 Excel Discussion (Misc queries) 0 February 7th 05 05:19 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM
Statement lintan Excel Worksheet Functions 1 December 2nd 04 11:31 PM


All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"