Ifs statement help / results not as expected..

KJ318

New Member
Joined
Feb 18, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello Community,

I would be grateful for any help with the following problem please:

I have two sheets as follows:
  1. Look Up date with values (£) to look up.
  2. Main sheet to bring back the values (£) and compare the values (£) against existing values (£)
I've used xlookup to look up the vales and IFS to check the values, for the most part the IFS returns the correct result but for one of the results, the return value is incorrect.

I've inserted a picture of where the result is incorrect and highlighted the row, I cannot figure out what's gone wrong...all values are formatted as Currency, I've check the data with the isnumber() and it returns a true on the look up data and main sheet...is the logic in the ifs incorrect, if so, why is only one particular row showing an incorrect result?

Any help / info would be most appreciated.

Kind regards,
KJ.
 

Attachments

  • Capture.PNG
    Capture.PNG
    26.4 KB · Views: 5
  • Capture1.PNG
    Capture1.PNG
    74.9 KB · Views: 5

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
My guess: If you temporarily format D11 and E11 as Number with 13 decimal places (15 significant digits, the most that Excel formats), you will see that D11 is indeed larger than E11.

If one or both columns are calculated, you should explicitly round to 2 decimal places, either in the cells themselves or at least in the IFS expression (column F).

FYI, you can replace the last test (D11>E11) with simply TRUE, since you already established that D11=E11 and D11<E11 are false.

-----

Another possibility: D11 is text, and E11 is numeric. Looks can be deceiving, and the format of the cell does not matter. Use ISTEXT(D11) to determine.

(In Excel, all text is consider greater than any numeric value.)
 
Last edited:
Upvote 0
Thank you, Joe, you were on the money, D11 is larger than E11:

1609526831489.png


Thank you for the note about rounding and the final test in the ifs function; most helpful.

Much appreciated.

Kind regards
 

Attachments

  • Capture.PNG
    Capture.PNG
    35.9 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

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