If, multiple arguments

P

puiuluipui

Hi, i need an code with 12 arguments.

=IF(A1<H1,H1,IF(A1<H2,H2,IF(A1<H3,H3,IF(A1<H4,H4,IF(A1<H5,H5,IF(A1<H6,H6,IF(A1<H7,H7,IF(A1<H8,H8))))))))

This code is not working with more than 8 arguments, and i need 12.
I tried =choose, but still not working.
Any ideea?

Thanks!
 
L

Luke M

Without seeing your data, not sure if this will work perfectly, but you could
do something like:
=LOOKUP(A1+1,H1:H8)

The +1 is only in there because your arguements were less than (not less
than or equal). I'm also assuming the values in H1:H8 are at least more than
1 apart from each other.
 
P

puiuluipui

Hi,
H1=10000
H2=20000
H3=30000
....
....
H12=120000

let's say that A1=1250
1250 is smaller than 10000.i need the code to look in H1:H12 and in B1 the
code to display 8750, and in C1 to display 10000.
if A1=48000, result to be: B1=2000 and C1=50000

in C column i need a formula that retrieve the closes data from H column and
in B column the "same code"-A1





"Luke M" a scris:
 
B

Bernd P

Hello,

Its quite easy if you are able to and willing to rearrange your data
slightly:
Put 120000 into I1, 110000 into I2, 100000 into I3 and so on -
decreasing values starting with a very high value you will never
exceed.

Then you can enter into C1:
=-LOOKUP(-A1,-$I$1:$I$12)

And into B1:
=C1-A1

Regards,
Bernd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top