IF Statement that skips 0 and looks at the next real number

mminchev

New Member
Joined
Feb 16, 2018
Messages
23
I am trying to create and IF statement that basically will look at values in different cells in the same row and would give me the difference between each cell, however is there is a 0 in one cell it would look at the next available number in a cell that is not a zero and will give me that difference:

For Example:

If this is my row of numbers I would need to find the % difference between only the percent and skip the zeros


Week 1
Week 2
Week 3
Week 4
Week 5
Week 6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
0%
183%
0%
342%
0%
174%
0%
254%
0%
179%
0%
197%

<tbody>
</tbody>


So this means my IF statement would skip Week 1 and look at the difference of Week 4 - Week 2, how can I build and IF Statement that can do that?

I really appreciate the help, this is very time sensitive, It is probably simple, but I am drawing a blank!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
What are your expected results for that data?
 
Upvote 0
I am trying to find the difference between the weeks but instead of going in order Week 2 - Week 1, I want to skip the weeks that show 0% and go to the next real number, for example Week 4 - Week 2 and tell the If Statement to skip all the 0%
 
Upvote 0
Basically something like this:

IF(Week 1=0, then skip week 1 and look at the next number that is not zero and then subtract it from the next higher week number that is not a zero)
 
Upvote 0
So you don't know the results for you want for your example?
 
Upvote 0
Shg is asking for you to show what the output should look like based on your example provided. What should the ACTUAL resulting numbers be?
 
Upvote 0
Lets say Week 4 - Week 2 or 342-183=159

So I am trying to make the If Statement skip all the zeros and ignore them and just look at the numbers and get their difference.

So far I have something like this:

=IF(J4=0,"",IF(K4=0,"",IF(L4=0,"",IF(M4=0,"",IF(N4=0,"",IF(O4=0,"",IF(P4=0,"",IF(Q4=0,"",IF(R4=0,"",IF(S4=0,"",IF(T4=0,"",K4-J4)))))))))))

but I don't know how to put in there to just subtract the numbers and not every cell by the other, how to skip the cells with zeros in them and go and look at the next number

I don't know if I am making any sense, Im sorry, Ive just drawn a blank


Shg is asking for you to show what the output should look like based on your example provided. What should the ACTUAL resulting numbers be?
 
Upvote 0
What the results should look like after the If Statement:

Week 1Week 2Week 3Week 4Week 5Week 6Week 7Week 8Week 9Week 10Week 11Week 12
0%183%0%342%0%174%0%254%0%179%0%197%
RESULTS:
Week 4 - Week 2 Week 6 - Week 4 Week 8 - Week 6 Week 10 - Week 8 Week 12 - Week 10
0%0%0%159%0%-168%0%79%0%-75%0%19%
<colgroup><col width="74" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2706;" span="12"> <tbody> </tbody>



This. You're on the right track here as far as showing the expected results. Can you show more for the entire row you have in post #1 ?
 
Upvote 0

Forum statistics

Threads
1,215,809
Messages
6,127,012
Members
449,351
Latest member
Sylvine

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