how to change formula

KrazySmile

New Member
Joined
Jan 9, 2005
Messages
34
how can i get the remainder of a division on a formula?
(the equivalent to the % operator in C++, and Mod in VBA).

i have this:
=VLOOKUP(number;A1:B50;2;0)

what i want is that, instead of the value of 'number', i want it to search the remainder(rest) of the division of number/100, what in VBA, would b something like this (i gess):

aux = number Mod 100

thanks in advance

Filipe Silva
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
yes it does.. but now i have a little problem :S

=VLOOKUP((MOD(number; 100));C1:D50; 100;2;0) //this dont give the result i want, cause it looks on the range for the exact match;

what i really want it to do, is to check each cell in the range given, and compare the MOD(cell_value; 100), with MOD(number; 100);
and if both r equal, then, give back the number on the next column

i can i change the formula above (or a new one) ?

thanks
 
Upvote 0
If you don't want to find an exact match, change this:

KrazySmile said:
=VLOOKUP((MOD(number; 100));C1:D50; 100;2;0)

to this: =VLOOKUP((MOD(number; 100));C1:D50; 100;2;1)
 
Upvote 0
KrazySmile said:
i do want an axact match!

but betwen the right values, like i write above!

=INDEX($B$1:$B$50;MATCH(MOD(number;100),MOD($A$1:$A$50;100);0))

which must be confirmed with control+shift+enter instead of the usual enter.
 
Upvote 0
KrazySmile said:
:confused: it dosent work :confused:

That doesn't tell much. How do you suppose this enables one to diagnose the problem that you have with the formula?

(and what do u mean with the shift control enter)

This remark makes me believe that your attempt to use the formula ended up in #VALUE!. If so, you confirmed the formula with just enter instead of control+shift+enter (That is: Pressing Control and Shift keys at the same time followed by hitting the Enter key). Lookup the topics on the so-called "array formulas" in the Help file.
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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