Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
G Miller
 
Posts: n/a
Default Need a function to fill column from other columns

Hi all,
I am thinking that a long nested IF statement will accomplish my goal, but
I'm not sure how to lay it out. I have a blank column (M) that I want to fill
with a value from either column N, O, P, Q, or leave blank. Columns N, O, P,
and Q may be blank or contain a number (which may be zero). I want to go in
order, so that if the value in column N is not null and not zero, use that
value to fill column M; otherwise skip to column O and apply the same test,
and so on. If I get all the way to column Q and all the columns N-Q are blank
or zero, then I want to leave column M blank. I'll try and write it out:
If N2 is not null and N20, then M2=N2, else M2=O2
If O2 is not null and O20, then M2=O2, else M2=P2
If P2 is not null and P20, then M2=P2, else M2=Q2
If Q2 is not null and Q20, the M2=Q2, else M2=""

Any suggestions? My thanks in advance.
Gretta
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark
 
Posts: n/a
Default Need a function to fill column from other columns

you might try this formula in M1:=SUBTOTAL(4,N1:Q1). That will always
yield whatever the maximum value is in N1:Q1. I'm not sure if that is
the same as what you asked, but I am guessing that should do the same
thing. Look at the help on the Subtotal function for more options.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
William Horton
 
Posts: n/a
Default Need a function to fill column from other columns

Try the below formula which assumes the values you want to check are in cells
N1:Q1.

=IF(OR(N1=0,ISBLANK(N1)),IF(OR(O1=0,ISBLANK(O1)),I F(OR(P1=0,ISBLANK(P1)),IF(OR(Q1=0,ISBLANK(Q1)),"", Q1),P1),O1),N1)

Hope this helps.

Thanks,
Bill Horton

"G Miller" wrote:

Hi all,
I am thinking that a long nested IF statement will accomplish my goal, but
I'm not sure how to lay it out. I have a blank column (M) that I want to fill
with a value from either column N, O, P, Q, or leave blank. Columns N, O, P,
and Q may be blank or contain a number (which may be zero). I want to go in
order, so that if the value in column N is not null and not zero, use that
value to fill column M; otherwise skip to column O and apply the same test,
and so on. If I get all the way to column Q and all the columns N-Q are blank
or zero, then I want to leave column M blank. I'll try and write it out:
If N2 is not null and N20, then M2=N2, else M2=O2
If O2 is not null and O20, then M2=O2, else M2=P2
If P2 is not null and P20, then M2=P2, else M2=Q2
If Q2 is not null and Q20, the M2=Q2, else M2=""

Any suggestions? My thanks in advance.
Gretta

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark
 
Posts: n/a
Default Need a function to fill column from other columns

Sorry, got ahead of myself. If you want M1 to be blank if there are no
qualifying values (0,null) in N1:Q1 then use this instead of what I
said last:=IF(SUBTOTAL(4,N1:Q1)=0,"",SUBTOTAL(4,N1:Q1))
That should do it!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
G Miller
 
Posts: n/a
Default Need a function to fill column from other columns

This sounds great except that I don't want to use the maximum value across
the rows, I need to use them in the order of priority (N, then O, then P,
then Q). But I'm sure I'll sure this another time! Thanks.

"Mark" wrote:

Sorry, got ahead of myself. If you want M1 to be blank if there are no
qualifying values (0,null) in N1:Q1 then use this instead of what I
said last:=IF(SUBTOTAL(4,N1:Q1)=0,"",SUBTOTAL(4,N1:Q1))
That should do it!




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
G Miller
 
Posts: n/a
Default Need a function to fill column from other columns

Bill, this works perfectly!!! Thank you so much.

Gretta

"William Horton" wrote:

Try the below formula which assumes the values you want to check are in cells
N1:Q1.

=IF(OR(N1=0,ISBLANK(N1)),IF(OR(O1=0,ISBLANK(O1)),I F(OR(P1=0,ISBLANK(P1)),IF(OR(Q1=0,ISBLANK(Q1)),"", Q1),P1),O1),N1)

Hope this helps.

Thanks,
Bill Horton

"G Miller" wrote:

Hi all,
I am thinking that a long nested IF statement will accomplish my goal, but
I'm not sure how to lay it out. I have a blank column (M) that I want to fill
with a value from either column N, O, P, Q, or leave blank. Columns N, O, P,
and Q may be blank or contain a number (which may be zero). I want to go in
order, so that if the value in column N is not null and not zero, use that
value to fill column M; otherwise skip to column O and apply the same test,
and so on. If I get all the way to column Q and all the columns N-Q are blank
or zero, then I want to leave column M blank. I'll try and write it out:
If N2 is not null and N20, then M2=N2, else M2=O2
If O2 is not null and O20, then M2=O2, else M2=P2
If P2 is not null and P20, then M2=P2, else M2=Q2
If Q2 is not null and Q20, the M2=Q2, else M2=""

Any suggestions? My thanks in advance.
Gretta

Reply
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
Fill the entire column with a function [email protected] Excel Discussion (Misc queries) 1 September 29th 05 11:26 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
print 3 column range in six columns dawgpilot Excel Discussion (Misc queries) 3 April 28th 05 10:53 PM
how can i fill blank cells in column with abc while the right col. khurram saddique Excel Discussion (Misc queries) 2 February 12th 05 03:25 PM
Naming column in Index Function mlkpied Excel Worksheet Functions 3 December 7th 04 12:20 AM


All times are GMT +1. The time now is 03:26 AM.

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

About Us

"It's about Microsoft Excel"