Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default copying formula to another cell


Have formula =if(a1=1,"1",if(b1=2","2")) in Column E. How do i drag the
formula to Columns F and G so that the formula changes show
=if(a2=1,"1",if(b2=2,"2")) in row F and =IF(a3=1,"1",if(b3=1"1")) in row G.

Currently if i drag the formula to another column in Row E, i get the
following result: =if(b1=1,"1",if(c1=2"2")) and =if(c1=1"1",if(d1=2,"2")).

Hope this makes sense!!
--
thanx
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default copying formula to another cell


dmack wrote:
Have formula =if(a1=1,"1",if(b1=2","2")) in Column E. How do i drag the
formula to Columns F and G so that the formula changes show
=if(a2=1,"1",if(b2=2,"2")) in row F and =IF(a3=1,"1",if(b3=1"1")) in row G.

Currently if i drag the formula to another column in Row E, i get the
following result: =if(b1=1,"1",if(c1=2"2")) and =if(c1=1"1",if(d1=2,"2")).

Hope this makes sense!!
--
thanx


The easiest way (if you don't have to do it too many times) would be to
use fill down (that is what you are referring to when you say "drag" I
think - you're clicking on the bottom right corning and "dragging" the
cursor somewhere) to fill the formulas into E1:E3. Then just move the
formula in E2 to F1 (mouse over the edge of the cells until the plus
turns into a plus with arrows on the end, then click and drag).

To keep a formula from changing the relative reference when you fill
right to left, you can use the $
e.x.=if($a1=1,"1",if($b1=2,"2"))
If this is in E1 and you fill it to F1, you will have the same formula.
But, if you fill down from E1 to E2, the formula will be
=if($a2=1,"1",if($b2=2,"2"))
Hope this helps!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default copying formula to another cell

Try this:

=IF(INDEX($A:$A,COLUMNS($A:A))=1,"1",IF(INDEX($B:$ B,COLUMNS($A:A))=2,"2"))

Comments:

Do you really want quotes around "1" and "2"?
This makes them TEXT, *not* numbers.

Your formula has no return if Column A and Column B *do not* contain a 1 and
a 2,
Just a FALSE display.
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"dmack" wrote in message
...

Have formula =if(a1=1,"1",if(b1=2","2")) in Column E. How do i drag the
formula to Columns F and G so that the formula changes show
=if(a2=1,"1",if(b2=2,"2")) in row F and =IF(a3=1,"1",if(b3=1"1")) in row G.

Currently if i drag the formula to another column in Row E, i get the
following result: =if(b1=1,"1",if(c1=2"2")) and =if(c1=1"1",if(d1=2,"2")).

Hope this makes sense!!
--
thanx


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default copying formula to another cell

There's probably some macro or VB code to do it, but my way would be:

copy your forumla down the column
highlight the column, find "A", replace with $A$ then do the same for "B"
Copy -Paste Special -Transpose
Will flip it sideways.
Then you delete the formulas that are still in column format.


"dmack" wrote:


Have formula =if(a1=1,"1",if(b1=2","2")) in Column E. How do i drag the
formula to Columns F and G so that the formula changes show
=if(a2=1,"1",if(b2=2,"2")) in row F and =IF(a3=1,"1",if(b3=1"1")) in row G.

Currently if i drag the formula to another column in Row E, i get the
following result: =if(b1=1,"1",if(c1=2"2")) and =if(c1=1"1",if(d1=2,"2")).

Hope this makes sense!!
--
thanx

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 620
Default copying formula to another cell

To start with, your column E formula has an error (an unmatched extra double
quote mark).
I assume that you mean =if(a1=1,"1",if(b1=2,"2")) [but see also the last
para of my reply]?
In most of your other formulae, you're missing a comma, so again have
invalid syntax. Rather than typing the formulae into the message, you're
better off copying and pasting, then you hopefully won't suffer from
typographical errors.
Furthermore, you're likely to confuse folk when you get muddled up between
rows and columns. There isn't a row E, row F, or row G.

Having cured that, you can hopefully get the result you want by using
=IF(OFFSET($A1,COLUMN()-5,0)=1,"1",IF(OFFSET($B1,COLUMN()-5,0)=2,"2"))

But do you really want your output to be "1" and "2" as text, or do you want
numbers? If numbers, throw away the quote marks.
--
David Biddulph

"dmack" wrote in message
...

Have formula =if(a1=1,"1",if(b1=2","2")) in Column E. How do i drag the
formula to Columns F and G so that the formula changes show
=if(a2=1,"1",if(b2=2,"2")) in row F and =IF(a3=1,"1",if(b3=1"1")) in row
G.

Currently if i drag the formula to another column in Row E, i get the
following result: =if(b1=1,"1",if(c1=2"2")) and =if(c1=1"1",if(d1=2,"2")).

Hope this makes sense!!
--
thanx



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
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Same formula in each cell of column; insert rows w/o copying down tgdavis Excel Discussion (Misc queries) 3 September 14th 05 09:32 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Formula for copying a sequence for every 8th cell JBSAND1001 Excel Worksheet Functions 3 January 2nd 05 07:07 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 01:33 PM.

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"