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
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

KrazySmile

New Member
Joined
Jan 9, 2005
Messages
34
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
 

Tazguy37

MrExcel MVP
Joined
May 28, 2004
Messages
4,237
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)
 

KrazySmile

New Member
Joined
Jan 9, 2005
Messages
34

ADVERTISEMENT

i do want an axact match!

but betwen the right values, like i write above!
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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.
 

KrazySmile

New Member
Joined
Jan 9, 2005
Messages
34

ADVERTISEMENT

:confused: it dosent work :confused:

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

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,324
Messages
5,600,956
Members
414,417
Latest member
Nobu

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
Top