# answer based on cell contents

Been trying to get this working for a little while but quite new to formulas. What i need is

if A1 is less than 2 B1 should show 4, if A1 is between 2-3 B1 should be 6, if A1 is between 3-4 B1 should be 8, if A1 is between 4-5 B1 should be 10 and if a1 id greater than 5 then B1 should show A1 x 2

I am not sure if i have been searching the wrong terms but have been unable to find and answers.

edit retag close merge delete

"It"? you mean that A1 should be all these values based on A1 itself? or do you need that result in some different cell?

( 2018-07-13 14:49:01 +0200 )edit

sorry, yes the answer would be in a separate cell and all be based o the value of A1.

( 2018-07-13 15:00:12 +0200 )edit

Sort by » oldest newest most voted

=IF(A1<2;4;IF(A1<3;6;IF(A1<4;8;IF(A1<=5;10;A1*2))))

I took the liberty to decide which should be < and which <= - please tweak as required.

more

Brilliant thanks. That is exactly what i needed. i think i wasn't too far off but using commas instead of semi colons and i was trying to include the higher number which i see now was not necessary.

( 2018-07-13 15:26:42 +0200 )edit

Whether you can use comma as parameter separator depends on your settings based on your locale, however semicolon works in all locales (and then for display may get converted to comma again in your settings) that's why we prefer to use semicolon here for formula expression examples.

( 2018-07-13 23:09:02 +0200 )edit