IF statement that will change by 2 instead of 1 when I drag it down

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
784
Office Version
  1. 365
Platform
  1. Windows
Hi

Can I write an IF statement that will change by 2 instead of 1 when I drag it down?
Excel Formula:
=IF(B5=”x”,+C5,””)
I want the next line to be
Excel Formula:
=IF(B7=”x”,+C7,””)
Then the next line
Excel Formula:
=IF(B9=”x”,+C9,””)
All the way down to B45
If I copy the B5 statement down, it changes the B cell by 1. I need it to change by 2

The only way I know is to drag the first down, then delete every other line, then move the lines I didn’t delete up


mike
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
How about
Excel Formula:
=IF(INDEX(B:B,ROWS(M$3:M3)*2+3)="X",INDEX(C:C,ROWS(M$3:M3)*2+3),"")
 
Upvote 0
Solution
Hi Fluff,
Is M the column where the if statement goes?
I don't have time now, but I' try it this evening
I m trying to eliminate every other line to make it look nice. Now i have blank lines
B is where the "x" goes, C is a number
B is also where a "y" goes,
the if statement separates the two and gives a running total
the if statement starts in AC5 for "x" and
Ai5 for "y"
or course the x and y are longer words.
the data actually goes from B to G, but I thought if I had one statement correct, I can just change the letter :)
B is always "x" or "y", C,D,E,F,G is always numbers.
 
Upvote 0
Just change the M$3:M3 to reflect the first cell the formula is in.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,928
Members
449,094
Latest member
teemeren

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