Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to be able to move data from a group of columns (A,B,C) based on there being data in a fourth column (D) to a new group of columns (E,F,G).

A    B    C    D    E    F    G

20   0    0    15   15   0    0
0    10   0    5    0    5    0
0    0    90   90   0    0    90
0    0    0    0    0    0    0

When columns A, B and C are reported to have data and column D has data transfer the data from D to a corresponding column for A, B and C to be represented in columns E, F and G.

share|improve this question
    
You said "move data" and "transfer the data". Does this mean you want columns A, B & C values to be cleared after the data is transferred to E, F & G? Or do the original values stay? This will make a big difference how the question is answered. –  CharlieRB Jan 11 '13 at 12:53

2 Answers 2

An if statement might work.

in column E: =if($D1=requiredvalue,$A1,0)

You didn't mention what the required value was to find in column D. If you mean a value above zero use $D1>0. If you mean one particular value use what I mentioned above.

share|improve this answer

If I understood your question correctly, use the following formula:

  • E: =IF(AND($D1 > 0; $A1 > 0); $D1; 0)
  • F: =IF(AND($D1 > 0; $B1 > 0); $D1; 0)
  • G: =IF(AND($D1 > 0; $C1 > 0); $D1; 0)

Expand the formula from the first row to rows below.

The third argument to IF is the value of the cell in case where the condition is false. It could be any number or the value of a cell, for example $A1.

share|improve this answer
1  
Well, you can simplify that a little, to E1 = =IF($A1>0, $D1, 0). And, if you leave out the first $ and say =IF(A1>0, $D1, 0), you can just drag it out to columns F and G. –  Scott Jan 11 '13 at 21:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.